It depends on how your dimensions and attributes are set up but
something like the following would work if d2.Num and d3.Index were
exposes as attribute name or keys.
SUM(d3.index.[100]:d3.index.[500],(d2.num.[20],Measures.Amt))
If you have these columns exposed as member values you would need to use
the filter function to get the appropriate set of members.
SUM(
CROSSJOIN(
Filter(d3.Members,d3.CurrentMember.MemberValue >= 100
and d3.CurrentMember.MemberValue <= 500)
,
Filter(d2.Num.Members, d2.CurrentMember.memberValue = 20)
)
, Measures.Amt
)
--
Regards
Darren Gosbell - SQL Server MVP
Blog: http://www.geekswithblogs.net/darrengosbell
In article <1163710782.219834.137490 (AT) m73g2000cwd (DOT) googlegroups.com>,
vandana3 (AT) yahoo (DOT) com says...
Quote:
I am trying to create a calculated member with multiple dimensions as
conditions.
Same thing can be acheived by below SQL Script.
SELECT SUM(f.Amt)
FROM Fact f
inner join dimension1 d1 on d1.d1_ID = f.d1_ID
inner join dimension2 d2 on d2.d2_ID = f.d2_ID
inner join dimension3 d3 on d3.d3_ID = f.d3_ID
where d2.Num = 20 and d3.index >=100 and d3.index <=500
Num is a column in d2 table and index is a column in d3 table.
Please advise.
Thanks,
Dana |