UNION multiple MDX queries in SSAS (powerpivot) -
i have sort of difficulties trying join 2 mdx queries together. when running them separately work fine. script below
with member [measures].[parametercaption] [main_incidents].[priority].currentmember.member_caption member [measures].[parametervalue] [main_incidents].[priority].currentmember.uniquename member [measures].[parameterlevel] [main_incidents].[priority].currentmember.level.ordinal select { [measures].[parametercaption] ,[measures].[# incidents] ,[measures].[%sla] } on columns ,[main_incidents].[priority].allmembers on rows [model]; member [measures].[parametercaption] [main_incidents].[usr_directorate].currentmember.member_caption member [measures].[parametervalue] [main_incidents].[usr_directorate].currentmember.uniquename member [measures].[parameterlevel] [main_incidents].[usr_directorate].currentmember.level.ordinal select { [measures].[parametercaption] ,[measures].[# incidents] ,[measures].[%sla] } on columns ,[main_incidents].[usr_directorate].allmembers on rows [model];
the important bit me need label column show. want union
2 queries parametercaption captures values "priority" dimension , "directorate" dimension....
please me achieve this?
this bit complex, possible.
union in mdx works members of same hierarchy, achieve need make row members tuples combine 2 hierarchies. can cross joining each of allmembers sets [all] member other hierarchy. need change parameter caption, value , level conditionally value appropriate hierarchy.
this code below:
with member [measures].[parametercaption] iif([main_incidents].[priority].currentmember.level.ordinal = 0, [main_incidents].[usr_directorate].currentmember.member_caption, [main_incidents].[priority].currentmember.member_caption) member [measures].[parametervalue] iif([main_incidents].[priority].currentmember.level.ordinal = 0, [main_incidents].[usr_directorate].currentmember.uniquename, [main_incidents].[priority].currentmember.uniquename) member [measures].[parameterlevel] iif([main_incidents].[priority].currentmember.level.ordinal = 0, [main_incidents].[usr_directorate].currentmember.level.ordinal , [main_incidents].[priority].currentmember.level.ordinal) select { [measures].[parametercaption] ,[measures].[# incidents] ,[measures].[%sla] } on columns ,{ [main_incidents].[priority].allmembers * [main_incidents].[usr_directorate].[all], [main_incidents].[priority].[all] * [main_incidents].[usr_directorate].allmembers } on rows [model];
Comments
Post a Comment