![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello All, I am trying to get a measure that will sum the sales for this year. For example January Sales =10000 February Sales=20000 Thus in AS I want to see the Cumulative Sales for February=30000 What is the best way to do this? Thanks Clint |
#3
| |||
| |||
|
|
Check for the ytd() function. It would be something like sum(ytd([Time].[Calendar]), [Measures].[Sales]) Offcourse, to get results you would have to include time dimension in the query. MC "Clint" <ccpatriot12 (AT) yahoo (DOT) com> wrote in message news:upjoUEW%23FHA.2664 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Hello All, I am trying to get a measure that will sum the sales for this year. For example January Sales =10000 February Sales=20000 Thus in AS I want to see the Cumulative Sales for February=30000 What is the best way to do this? Thanks Clint |
#4
| |||
| |||
|
|
Hmm.. YTD isnt quite what I am after... Here is an example of what I have currently.. Using the Foodmart 2000 cube (SALES) WITH MEMBER Measures.[Cumulative Sales] AS 'SUM( HEAD( ORDER( {[Time].Siblings}, [Measures].[Unit Sales], BDESC ) AS OrderedSiblings, RANK( [Time], OrderedSiblings ) ), [Measures].[Unit Sales] )' SELECT ORDER( DESCENDANTS( [Time].&[1997] ), [Measures].[Unit Sales], BDESC ) ON COLUMNS, {[Measures].[Unit Sales], [Measures].[Cumulative Sales]} ON ROWS FROM [Sales] Basically what I want to see on Columns... are the months of 1997... and each month is cumulative.. The above code kind of works, but doesnt focus purely on month. I need some help on that. Thanks!! "MC" <marko_culo#@#yahoo#.#com#> wrote in message news:u7o8XnW%23FHA.2320 (AT) TK2MSFTNGP11 (DOT) phx.gbl... Check for the ytd() function. It would be something like sum(ytd([Time].[Calendar]), [Measures].[Sales]) Offcourse, to get results you would have to include time dimension in the query. MC "Clint" <ccpatriot12 (AT) yahoo (DOT) com> wrote in message news:upjoUEW%23FHA.2664 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Hello All, I am trying to get a measure that will sum the sales for this year. For example January Sales =10000 February Sales=20000 Thus in AS I want to see the Cumulative Sales for February=30000 What is the best way to do this? Thanks Clint |
#5
| |||
| |||
|
|
Could you explain why something like doesnt work: WITH MEMBER [measures].[cumulative sales] as ' sum(ytd([Time].[Calendar]), [Measures].[Sales]) ' select [Time].[Calendar].[Month].members, --- put here descendants of 1997 or something like that [measures].[cumulative sales] on rows from..... MC "Clint" <ccpatriot12 (AT) yahoo (DOT) com> wrote in message news:OPPbRfe%23FHA.3064 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Hmm.. YTD isnt quite what I am after... Here is an example of what I have currently.. Using the Foodmart 2000 cube (SALES) WITH MEMBER Measures.[Cumulative Sales] AS 'SUM( HEAD( ORDER( {[Time].Siblings}, [Measures].[Unit Sales], BDESC ) AS OrderedSiblings, RANK( [Time], OrderedSiblings ) ), [Measures].[Unit Sales] )' SELECT ORDER( DESCENDANTS( [Time].&[1997] ), [Measures].[Unit Sales], BDESC ) ON COLUMNS, {[Measures].[Unit Sales], [Measures].[Cumulative Sales]} ON ROWS FROM [Sales] Basically what I want to see on Columns... are the months of 1997... and each month is cumulative.. The above code kind of works, but doesnt focus purely on month. I need some help on that. Thanks!! "MC" <marko_culo#@#yahoo#.#com#> wrote in message news:u7o8XnW%23FHA.2320 (AT) TK2MSFTNGP11 (DOT) phx.gbl... Check for the ytd() function. It would be something like sum(ytd([Time].[Calendar]), [Measures].[Sales]) Offcourse, to get results you would have to include time dimension in the query. MC "Clint" <ccpatriot12 (AT) yahoo (DOT) com> wrote in message news:upjoUEW%23FHA.2664 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Hello All, I am trying to get a measure that will sum the sales for this year. For example January Sales =10000 February Sales=20000 Thus in AS I want to see the Cumulative Sales for February=30000 What is the best way to do this? Thanks Clint |
#6
| |||
| |||
|
|
You know what... YTD will indeed work... Now why doesn't any source MDX book or otherwise detail this as a solution... Why do they go into order, head and rank... sigh.. Thanks!!! I really appreciate all your help MC. "MC" <marko_culo#@#yahoo#.#com#> wrote in message news:uZ5F1wj%23FHA.272 (AT) tk2msftngp13 (DOT) phx.gbl... Could you explain why something like doesnt work: WITH MEMBER [measures].[cumulative sales] as ' sum(ytd([Time].[Calendar]), [Measures].[Sales]) ' select [Time].[Calendar].[Month].members, --- put here descendants of 1997 or something like that [measures].[cumulative sales] on rows from..... MC "Clint" <ccpatriot12 (AT) yahoo (DOT) com> wrote in message news:OPPbRfe%23FHA.3064 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Hmm.. YTD isnt quite what I am after... Here is an example of what I have currently.. Using the Foodmart 2000 cube (SALES) WITH MEMBER Measures.[Cumulative Sales] AS 'SUM( HEAD( ORDER( {[Time].Siblings}, [Measures].[Unit Sales], BDESC ) AS OrderedSiblings, RANK( [Time], OrderedSiblings ) ), [Measures].[Unit Sales] )' SELECT ORDER( DESCENDANTS( [Time].&[1997] ), [Measures].[Unit Sales], BDESC ) ON COLUMNS, {[Measures].[Unit Sales], [Measures].[Cumulative Sales]} ON ROWS FROM [Sales] Basically what I want to see on Columns... are the months of 1997... and each month is cumulative.. The above code kind of works, but doesnt focus purely on month. I need some help on that. Thanks!! "MC" <marko_culo#@#yahoo#.#com#> wrote in message news:u7o8XnW%23FHA.2320 (AT) TK2MSFTNGP11 (DOT) phx.gbl... Check for the ytd() function. It would be something like sum(ytd([Time].[Calendar]), [Measures].[Sales]) Offcourse, to get results you would have to include time dimension in the query. MC "Clint" <ccpatriot12 (AT) yahoo (DOT) com> wrote in message news:upjoUEW%23FHA.2664 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Hello All, I am trying to get a measure that will sum the sales for this year. For example January Sales =10000 February Sales=20000 Thus in AS I want to see the Cumulative Sales for February=30000 What is the best way to do this? Thanks Clint |
#7
| |||
| |||
|
Dont know, never read them . Feel free to contact me if you need morehelp. MC "Clint" <ccpatriot12 (AT) yahoo (DOT) com> wrote in message news:eKsqe9q%23FHA.2628 (AT) TK2MSFTNGP11 (DOT) phx.gbl... You know what... YTD will indeed work... Now why doesn't any source MDX book or otherwise detail this as a solution... Why do they go into order, head and rank... sigh.. Thanks!!! I really appreciate all your help MC. "MC" <marko_culo#@#yahoo#.#com#> wrote in message news:uZ5F1wj%23FHA.272 (AT) tk2msftngp13 (DOT) phx.gbl... Could you explain why something like doesnt work: WITH MEMBER [measures].[cumulative sales] as ' sum(ytd([Time].[Calendar]), [Measures].[Sales]) ' select [Time].[Calendar].[Month].members, --- put here descendants of 1997 or something like that [measures].[cumulative sales] on rows from..... MC "Clint" <ccpatriot12 (AT) yahoo (DOT) com> wrote in message news:OPPbRfe%23FHA.3064 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Hmm.. YTD isnt quite what I am after... Here is an example of what I have currently.. Using the Foodmart 2000 cube (SALES) WITH MEMBER Measures.[Cumulative Sales] AS 'SUM( HEAD( ORDER( {[Time].Siblings}, [Measures].[Unit Sales], BDESC ) AS OrderedSiblings, RANK( [Time], OrderedSiblings ) ), [Measures].[Unit Sales] )' SELECT ORDER( DESCENDANTS( [Time].&[1997] ), [Measures].[Unit Sales], BDESC ) ON COLUMNS, {[Measures].[Unit Sales], [Measures].[Cumulative Sales]} ON ROWS FROM [Sales] Basically what I want to see on Columns... are the months of 1997... and each month is cumulative.. The above code kind of works, but doesnt focus purely on month. I need some help on that. Thanks!! "MC" <marko_culo#@#yahoo#.#com#> wrote in message news:u7o8XnW%23FHA.2320 (AT) TK2MSFTNGP11 (DOT) phx.gbl... Check for the ytd() function. It would be something like sum(ytd([Time].[Calendar]), [Measures].[Sales]) Offcourse, to get results you would have to include time dimension in the query. MC "Clint" <ccpatriot12 (AT) yahoo (DOT) com> wrote in message news:upjoUEW%23FHA.2664 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Hello All, I am trying to get a measure that will sum the sales for this year. For example January Sales =10000 February Sales=20000 Thus in AS I want to see the Cumulative Sales for February=30000 What is the best way to do this? Thanks Clint |
![]() |
| Thread Tools | |
| Display Modes | |
| |