Reputation: 319
I created Calculation Member which one shows a percentage ratio transactions amount to concrete institution.
Case When IsEmpty ( [Measures].[Zlicz transakcje] )
Then Null
Else ROUND((( [Klient].[Instytucja].[Klient].CurrentMember,
[Measures].[Zlicz transakcje] )
/
( Root ( [Klient] ), [Measures].[Zlicz transakcje] )) *100, 2 )
End
The result of my query looks like:
Query: How to change MDX query to shows percentage usage for all institutions (except for "Brak instytucji") grouped in one rows (I mean one row with 13,05 value)?
Upvotes: 0
Views: 55
Reputation: 35557
Couple of things I'd recommend
CASE
- general rul-of-thumb is that IIF
is quicker.DIVIDE
function.Code would now be something like this:
IIF(
[Measures].[Zlicz transakcje] = 0
, NULL
, ROUND(
100 *
DIVIDE(
( [Klient].[Instytucja].[Klient].CurrentMember, [Measures].[Zlicz transakcje] )
, ( [Klient].[Instytucja].[All], [Measures].[Zlicz transakcje] )
)
, 2
)
You can create an aggregated member that excludes Brak instytucji:
AGGREGATE(
EXCEPT(
[Klient].[Instytucja].[Klient].MEMBERS
,[Klient].[Instytucja].[Klient].[Brak instytucji]
)
)
)
Upvotes: 1