August 8, 2012 at 7:27 am
We have to write MDX query for following scenario:
Query parameter as Fiscal Week
I have to write query in which coalition and brand should come on rows and “YTD Sales value” and “YTD Sales value with PP rate” should come on column.
In order to calculate the “YTD Sales Value with PP rate” we have to the apply the exchange rate of each month of the prior period to the corresponding month of the selected period it would help while comparison of current period value with previous period value so that does not show differences because rate changes frequently.
1) We have to get the ParallelPeriod of month set and get its rate one by one because every month has different rate.
2) Now in loop we have to divide the each month in current period set to the rate of same month in previous period
August 8, 2012 at 9:25 am
http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply