Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

markramiro
Contributor II

Straight Table (totals and %)

Hi,

I have a straight table that looks like this.

StatusGroup AGroup B
Active64
Completed1216

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:

StatusGroup AGroup A %Group BGroup B%
Active650%420%
Completed650%1680%

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?

1 Solution

Accepted Solutions
Highlighted
markramiro
Contributor II

Re: Straight Table (totals and %)

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.

View solution in original post

2 Replies
Highlighted
markramiro
Contributor II

Re: Straight Table (totals and %)

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.

View solution in original post

jaumecf23
Contributor III

Re: Straight Table (totals and %)

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])