I have a bar chart for which I have 4 dimensions and 4 expressions. Lets give them random names before I start describing my problem (screen shots have the real names I have used)
Note: Dimensions are cyclic grouped and Expressions are also cyclic grouped (Please see attached screen shots)
DimA - formula used is =Aggr(DISTINCT ROUND(DimA, .1), DimA)
ExpA - formula used is =Count(ROUND(DimA, .1))
The same formula applies to all other dimensions and expressions (Only the dimension and expression names change in the formula).
Apparently, currently the users when they select ExpA then they must select DimA to see the correct results in the graph. Similary if they select ExpB then DimB must be selected to see the correct results.
This is a bit annoying sometimes and I wanted to know if there is a way by which I can achieve the following
1. Whenver user selects an ExpA automatically DimA must be selected.
2. Above must apply to all other expressions.
3. Show only the result of one selected expression (with one dimension) at a time.
Is this doable in any way?
By using GetCurrentField(), we can get the selected dimension in a Group. By getting the dimension, using If() in expression you can achieve this in a single expression like below
=If(GetCurrentField(GroupName) = 'Dimension1', Expression1,
if(GetCurrentField(GroupName) = 'Dimension2', Expression2,
if(GetCurrentField(GroupName) = 'Dimension3', Expression3, Expression4)))
Hope this helps you.
Now you don't need four expression, single dynamic expression serves your purpose.
Thanks for the response but I'm afraid this will not work for me. The reason being GetCurrentField() only works if the group contains fields whereas mine consists of formula's (please check my first post above).