|MDX-How do you write query that returns measure ratio to parent value?|
|Written by Vidas Matelis|
|Tuesday, 24 April 2007 19:16|
Q: How do you write MDX query that returns measure ratio to parent value?
A: Below is example on how is ratio calculated for measure [Order Count] using Date dimension. Using parent function, your MDX is independant on level that you are querying data on. In example below, if you query data at year level, ratio will be calculated to level [All]:
Results of query above:
If you query data at month level, ratio will be calculated comparing to level quarter:
Result of this query:
- How to install Adventure Works SQL DW and Analysis Services 2005/2008 sample database and project
- MDX-How can I get Last (Previous) Year to Date (YTD) values?
- What TCP port SQL Server Analysis Services 2005 uses
- MDX-How do you calculate monthly average of one year, optionally including empty months?
- MDX-How do I calculate sales for 12 Month to date?