Created
October 16, 2012 14:58
-
-
Save pstoellberger/3899805 to your computer and use it in GitHub Desktop.
Conditional Formatting in Saiku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In the mondrian schema xml: | |
----------------------------------------------------------------------------------------------------------- | |
<CalculatedMember | |
name="Profit" | |
dimension="Measures"> | |
<Formula>[Measures].[Store Sales] - [Measures].[Store Cost]</Formula> | |
<CalculatedMemberProperty name="FORMAT_STRING" expression="Iif(([Measures].[Store Sales] - [Measures].[Store Cost]) < 10000, '|(#,##0.00 €)|style=red', '|#,##0.00 €|style=green')"/> | |
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="4"/> | |
</CalculatedMember> | |
MDX Example: | |
----------------------------------------------------------------------------------------------------------- | |
WITH MEMBER Measures.ProfitFormatted as Measures.Profit, FORMAT_STRING = IIf(Measures.Profit > 2000, "|### €|style='lightgreen'|link='http://www\.analytical-labs\.com?profit\=" || Cast(Product.CurrentMember.Name as STRING) || "'|","|(### €)|style='red'|") | |
SELECT | |
NON EMPTY CrossJoin({[Gender].[All Gender].Children}, {[Measures].[ProfitFormatted]}) ON COLUMNS, | |
NON EMPTY {Hierarchize({[Product].[Product Category].Members})} ON ROWS | |
FROM [Sales] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment