I am trying to aggragate based on a condition in two expressions. It works fine when I do it with the group dimension for both expressions but only the Group Count dimension works when I take out the Group Id dimension (below). I know the expressions are different but I want the Revenue Impact expression to aggragate (and work like) the Group Count expression. The expressions:
Group Count:
count(if(aggr(($(vBenFactorCur)/$(vMemberCntCur)) - ($(vBenFactorPrev)/$(vMemberCntPrev)),[Group ID],[Incurred Year Month (Analytical)])<.0, [Group ID]))
Revenue Impact:
if(aggr(($(vBenFactorCur)/$(vMemberCntCur)) - ($(vBenFactorPrev)/$(vMemberCntPrev)),[Group ID],[Incurred Year Month (Analytical)])<-0, sum({<[Incurred Year Month Type]={'Current'}>}[PMPM Premium])-sum({<[Incurred Year Month Type]={'Previous'}>}[PMPM Premium]),0)
Incurred Year Month (Analytical) | Group ID | Group Count | Revenue Impact |
| | 260 | 0 |
201301 | 7000 | 1 | -446,290 |
201301 | 1005 | 1 | -97,003 |
201301 | 3092 | 1 | -23,549 |
201301 | 1034 | 1 | -17,745 |
201301 | 6056 | 1 | -15,883 |
201301 | 1797 | 1 | -15,660 |
201301 | 1551 | 1 | -8,633 |
201301 | 9055 | 1 | -7,730 |
201301 | 3132 | 1 | -4,344 |
201301 | 1103 | 1 | -3,901 |
Incurred Year Month (Analytical) | Group Count | Revenue Impact |
| 260 | 0 |
201301 | 260 | 0 |