Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a straight table that looks like this.
Status | Group A | Group B |
---|---|---|
Active | 6 | 4 |
Completed | 12 | 16 |
Dimension is simply [Status]
Expression for Group A is count({<[Group]={'Group A'}>}DISTINCT [ID])
Expression for Group B is count({<[Group]={'Group B'}>}DISTINCT [ID])
Now I want to add an expression for Group A % and Group B %. I want Group A % to be the % of each Status over the total for Group A and likewise for Group B %, it would be the % of each Status over the total for Group B. Result would be:
Status | Group A | Group A % | Group B | Group B% |
---|---|---|---|---|
Active | 6 | 50% | 4 | 20% |
Completed | 6 | 50% | 16 | 80% |
So essentially for Group A%, the expression would be something like:
count({<[Group]={'Group A'}>}DISTINCT [ID]) divided by the count of total [ID] for Group A
Any ideas?
No need to respond. I created variables for the totals which I then used on the divisor of the expressions. At first I was exploring handling this through the expression since I had incorrectly assumed the totals from the variables would not update based on selection.
No need to respond. I created variables for the totals which I then used on the divisor of the expressions. At first I was exploring handling this through the expression since I had incorrectly assumed the totals from the variables would not update based on selection.
Hi,
I think that also this formulas should work:
count({<[Group]={'Group A'}>}DISTINCT [ID])/count(TOTAL{<[Group]={'Group A'}>}DISTINCT [ID])
count({<[Group]={'Group B'}>}DISTINCT [ID])/count(TOTAL{<[Group]={'Group B'}>}DISTINCT [ID])