Saturday, February 25, 2012

MDX Query - Help needed from experienced

Ingen
=====
GA - Georgia
--County1
-- SharedFlag
--County2
-- SharedFlag
NC - North Carolina
--County1
-- SharedFlag
--County2
-- SharedFlag
MD - Maryland
--County1
-- SharedFlag
--County2
-- SharedFlag
Query 1:
Select Non Empty [InGen].[State Name].Members on Columns from [Firm
Reporting]
.................................
Could get all states as columns
Query 2:
with
set [SLA] as 'Filter( [InGen].[County Name].Members,
[InGen].CurrentMember.Properties("SharedFlag") = "A" OR
[InGen].CurrentMember.Properties("SharedFlag") = "Y" )'
Select Non Empty {SLA} On Columns From [Firm Reporting]
.................
Could get all county names those are having SharedProperty of A or Y
Question: How can I get states on columns if any one of their counties has a
Shared Property of A or Y ?
I do not have much experience but I tried hard to get this query
(essentially it is a clubbing the above two queries) but with no luck. Can
any body help me ? Thanks in advance.
I think the following should work, drilling up from the counties to the
State Name level.
eg.
[vbcol=seagreen]
with
set [SLA] as 'DrillUpLevel(Filter( [InGen].[County Name].Members,
[InGen].CurrentMember.Properties("SharedFlag") = "A" OR
[InGen].CurrentMember.Properties("SharedFlag") = "Y" ),[Ingen].[State
Name])'
Select Non Empty {SLA} On Columns From [Firm Reporting]
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell
In article <emQQiftUGHA.224@.TK2MSFTNGP10.phx.gbl>, "saiser" <norep>
says...
> Ingen
> =====
> GA - Georgia
> --County1
> -- SharedFlag
> --County2
> -- SharedFlag
> NC - North Carolina
> --County1
> -- SharedFlag
> --County2
> -- SharedFlag
> MD - Maryland
> --County1
> -- SharedFlag
> --County2
> -- SharedFlag
> Query 1:
> Select Non Empty [InGen].[State Name].Members on Columns from [Firm
> Reporting]
> .................................
> Could get all states as columns
>
> Query 2:
> with
> set [SLA] as 'Filter( [InGen].[County Name].Members,
> [InGen].CurrentMember.Properties("SharedFlag") = "A" OR
> [InGen].CurrentMember.Properties("SharedFlag") = "Y" )'
> Select Non Empty {SLA} On Columns From [Firm Reporting]
> ................
> Could get all county names those are having SharedProperty of A or Y
>
> Question: How can I get states on columns if any one of their counties has a
> Shared Property of A or Y ?
> I do not have much experience but I tried hard to get this query
> (essentially it is a clubbing the above two queries) but with no luck. Can
> any body help me ? Thanks in advance.
>
>

No comments:

Post a Comment