Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Christina Agyeman
Starting Member
15 Posts |
Posted - 2002-03-13 : 10:41:12
|
I am trying to create a period to date calculation based on our sales plus remaining forecast for a given day in a month .The function i'm trying to create should return a sum of all sales from the beginning of the month to the current day + sum of forecast from the following day to the end of the month.My Date dim. is set up [year].[quarter].[month].[day]I have started with the following codesum(PeriodsToDate([Time].[Month]),[Measures].[Sales]) + ???? How can I get a total for forecast for the following day till the end of month. |
|
chadmat
The Chadinator
1974 Posts |
Posted - 2002-03-27 : 14:35:36
|
MDX is not really my forte, but here it goes. (BTW I didn't test this, because I don't have a cube that I can test it against, so the syntax may not be exactly right, but you should get the gist of what I am trying to do):with member [Measures].[ROMForcast] as '([Measures].[Forcast Sales], [Time].[Month].currentmember - PeriodsToDate([Time].[Month]),[Measures].[Forcast Sales])'sum(PeriodsToDate([Time].[Month]),[Measures].[Sales]) + ([Measures].[ROMForcast])-Chad |
|
|
|
|
|