MDX: Calculating avg action time and change over time, for top 5 actions -


i have "actions" cube. dimensions "time" , "action id" , measurements "number of actions" , "total time" , calculated measurement "average action time". trying calculate top 5 actions avg time, , show change previous day. can in 2 separate queries:

select {[measures].[avg action time]} on columns, non empty topcount( except([action id].members, {[action id].[all action ids]}), 5, [measures].[avg action time]) on rows actions [time].[2005].[1]; 

and:

with member [measures].[change] ([time].currentmember, [measures].[number of actions]) / (parallelperiod ([day], 1, [time].currentmember), [measures].[number of actions]), format_string = 'percent' select [measures].[change] on columns, non empty [time].[2005].[1].children on rows [actions]; 

but can't figure out how combine them 1 mdx query. tried:

with member [measures].[change] ([time].currentmember, [action id].currentmember, [measures].[avg action time]) / (parallelperiod ([day], 1, [time].currentmember), [action id].currentmember, [measures].[avg action time]), format_string = 'percent' select {[measures].[avg action time], [measures].[change]} on columns, non empty topcount( except([action id].members, {[action id].[all action ids]}), 5, [measures].[avg action time]) on rows actions [time].[2005].[1]; 

but change percentage infinity, isn't calculating right thing. correct query?

the problem didn't have enough data in fact table. query works me different time range.

with member [measures].[change]  ([time].currentmember, [measures].[number of actions]) / (parallelperiod ([day], 1, [time].currentmember), [measures].[number of actions]), format_string = 'percent' select {[measures].[avg action time], [measures].[change]} on columns, non empty topcount( except([action id].members, {[action id].[all action ids]}), 5, [measures].[avg action time]) on rows actions [time].[2005].[1].[2]; 

Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -