![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
| WITH |
|
Hi, I want to show Percentage analysis on basis of # of passengers per City. I have the Detail data with pessenger information travelling in Tri rail per City. Now if i create a measure then i have only option to Sum or Count the records while i want to have a percentage. I dont know how i can do it in Cube.....any idea Regards, BizWorld |
#3
| |||
| |||
|
|
You would create a calculated measure with a formula something like the one in the formula below. The sample below works with the Foodmart 2000 database and takes the currently selected customer and returns the percentage against the "All Customers" member. WITH MEMBER Measures.Pcnt as '[Measures].[Sales Count]/(measures.[Sales Count],[Customers].[All Customers]) * 100' SELECT {Measures.[Sales Count], Measures.Pcnt} ON COLUMNS, {[Customers].[All Customers],[Customers].[City].Members} ON ROWS FROM Sales In your case you should be able to create a calculated measure in your cube that looks something like this "[Measures].[Passenger Count]/ (measures.[Passenger Count],[Locations].[All Locations]) * 100" assuming that your measure is called "Passenger Count" and your cities are stored in a dimension called "Locations". HTH -- Regards Darren Gosbell [MCSD] Blog: http://www.geekswithblogs.net/darrengosbell In article <eLIDz5L6FHA.1000 (AT) tk2msftngp13 (DOT) phx.gbl>, moonis.tahir (AT) gmail (DOT) com says... Hi, I want to show Percentage analysis on basis of # of passengers per City. I have the Detail data with pessenger information travelling in Tri rail per City. Now if i create a measure then i have only option to Sum or Count the records while i want to have a percentage. I dont know how i can do it in Cube.....any idea Regards, BizWorld |
#4
| |||
| |||
|
|
I am using this Syntax on one of my Cube. But it says Syntax error. any idea what i wrote wrong. WITH MEMBER Measures.Pcnt as '[Measures].[Total On Time]/(measures.[Totals],[TradeLane].[All TradeLane]) * 100' SELECT {measures.[Total On Time], Measures.Pcnt} ON COLUMNS, {[TradeLane].[All TradeLane],[TradeLane].[Port].Members} ON ROWS FROM OnTimePerformance "Darren Gosbell" <jam (AT) newsgroups (DOT) nospam> wrote in message news:MPG.1de2b39574d5e28f9897b5 (AT) news (DOT) microsoft.com... You would create a calculated measure with a formula something like the one in the formula below. The sample below works with the Foodmart 2000 database and takes the currently selected customer and returns the percentage against the "All Customers" member. WITH MEMBER Measures.Pcnt as '[Measures].[Sales Count]/(measures.[Sales Count],[Customers].[All Customers]) * 100' SELECT {Measures.[Sales Count], Measures.Pcnt} ON COLUMNS, {[Customers].[All Customers],[Customers].[City].Members} ON ROWS FROM Sales In your case you should be able to create a calculated measure in your cube that looks something like this "[Measures].[Passenger Count]/ (measures.[Passenger Count],[Locations].[All Locations]) * 100" assuming that your measure is called "Passenger Count" and your cities are stored in a dimension called "Locations". HTH |
#5
| |||
| |||
|
|
Hard to say, does the error give you an more info? Or is it just a generic "Syntax Error"? One thing that I don't understand is that you are referring to a measure called [Totals] after the division sign. I would have thought this should have been using the [Total On Time] measure. eg WITH MEMBER Measures.Pcnt as '[Measures].[Total On Time]/(measures.[Total On Time],[TradeLane].[All TradeLane]) * 100' SELECT {measures.[Total On Time], Measures.Pcnt} ON COLUMNS, {[TradeLane].[All TradeLane],[TradeLane].[Port].Members} ON ROWS FROM OnTimePerformance One other thing. It is hard to tell with the wrapping on these newsgroup posts and you are probably already doing this, but the formula should all be on one line. -- Regards Darren Gosbell [MCSD] Blog: http://www.geekswithblogs.net/darrengosbell In article <O3z4yuf6FHA.572 (AT) TK2MSFTNGP15 (DOT) phx.gbl>, moonis.tahir (AT) gmail (DOT) com says... I am using this Syntax on one of my Cube. But it says Syntax error. any idea what i wrote wrong. WITH MEMBER Measures.Pcnt as '[Measures].[Total On Time]/(measures.[Totals],[TradeLane].[All TradeLane]) * 100' SELECT {measures.[Total On Time], Measures.Pcnt} ON COLUMNS, {[TradeLane].[All TradeLane],[TradeLane].[Port].Members} ON ROWS FROM OnTimePerformance "Darren Gosbell" <jam (AT) newsgroups (DOT) nospam> wrote in message news:MPG.1de2b39574d5e28f9897b5 (AT) news (DOT) microsoft.com... You would create a calculated measure with a formula something like the one in the formula below. The sample below works with the Foodmart 2000 database and takes the currently selected customer and returns the percentage against the "All Customers" member. WITH MEMBER Measures.Pcnt as '[Measures].[Sales Count]/(measures.[Sales Count],[Customers].[All Customers]) * 100' SELECT {Measures.[Sales Count], Measures.Pcnt} ON COLUMNS, {[Customers].[All Customers],[Customers].[City].Members} ON ROWS FROM Sales In your case you should be able to create a calculated measure in your cube that looks something like this "[Measures].[Passenger Count]/ (measures.[Passenger Count],[Locations].[All Locations]) * 100" assuming that your measure is called "Passenger Count" and your cities are stored in a dimension called "Locations". HTH |
#6
| |||
| |||
|
|
i beleive i can use the same expression in Analysis Service 2005........ |
![]() |
| Thread Tools | |
| Display Modes | |
| |