Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm struggling with an expression formula. Heres what i want to do...
I have a chart. The dimension is called DispositionGroupName. My expression is a simple distinct count of EpisodeId. Here's where the fun starts....There are multiple Levels to Disposition Groups identified by the DispositionGroupLevelId (a hierachy). So i use set analysis in my expression to ensure i'm looking at only DispositionGroupLevelId = 4 by default.
Count({$<DispositionGroupLevelId={4},DispositionGroupOpenTreeView=>} distinct EpisodeId)
Users can select a Disposition group by using the treeview i created; DispositionGroupOpenTreeView. What i want to do is say.... If theres NO selection on 'DispositionGroupOpenTreeView' then use DispositionGroupLevelId = 4. Else... If there is a selection on DispositionGroupOpenTreeView, use the corresponding DispositionGroupLevelId in the expression.
I started trying to put it together, but realised because the user isnt making a selection directly on DispositionGroupLevelId, then i can't use 'GetFieldSelections'
=If(GetSelectedCount(DispositionGroupOpenTreeView) <> 1,
Count({$<DispositionGroupLevelId={4},DispositionGroupOpenTreeView=>} distinct EpisodeId),
Count({$<DispositionGroupLevelId = {"$(=GetFieldSelections(DispositionGroupLevelId))"}} DISTINCT EpisodeId))
HELP!
Thanks.
- Mathew.
SOLVED!
So i couldnt get to the answer yesterday, but walked in this morning with a clear head and solved it in 2 minutes.
Very simple really... just look for the max DispositionGroupLevelId based on whatever is selected.
=If(GetSelectedCount(DispositionGroupOpenTreeView) <> 1,
Count({$<DispositionGroupLevelId={4},DispositionGroupOpenTreeView=>} distinct EpisodeId),
Count({$<DispositionGroupLevelId = {"$(=Max(DispositionGroupLevelId))"},DispositionGroupOpenTreeView=>} DISTINCT EpisodeId))
SOLVED!
So i couldnt get to the answer yesterday, but walked in this morning with a clear head and solved it in 2 minutes.
Very simple really... just look for the max DispositionGroupLevelId based on whatever is selected.
=If(GetSelectedCount(DispositionGroupOpenTreeView) <> 1,
Count({$<DispositionGroupLevelId={4},DispositionGroupOpenTreeView=>} distinct EpisodeId),
Count({$<DispositionGroupLevelId = {"$(=Max(DispositionGroupLevelId))"},DispositionGroupOpenTreeView=>} DISTINCT EpisodeId))