Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Percentages in a trellis pie chart not equating to 100%

Hi

I am having an issue with one of my trellis pie charts in my application.

I have a trellis chart with pie charts with a secondary trellis dimension. I am carrying out a calculation under my expressions which will calculate the percentage.

So I have the expression COUNT(DISTINCT ID) / COUNT(TOTAL DISTINCT ID)

In the trellis pie chart, I am using three dimensions; Hotel, Flag and Grade.

I want to split the pie chart between two Grade values; Negative and Positive broken down by the Hotel and the Flag.

I want to be able to get the pie charts to equate to 100% all the time whenever you made a selection.

At the moment I am getting incorrect percentages which are not equating to 100%. Find below the screenshot.

Capture.PNG

As you can see the pie charts are not equating to 100%. I want them to equate to 100%

Am I doing something incorrect in my expression?

Is this possible to do?

Thanks

13 Replies
Colin-Albert

COUNT(DISTINCT ID) / COUNT(TOTAL <Hotel, Flag> DISTINCT ID)

trdandamudi
Master II
Master II

May be as below:

COUNT(DISTINCT ID) / COUNT(TOTAL  DISTINCT ID)

Not applicable
Author

Hi

Thanks for your reply.

When I use the expression you suggested, I get the following result:

Capture.PNG

Any ideas?

Thanks

Colin-Albert

Try just using the hotel dimension in the TOTAL expression

     COUNT(DISTINCT ID) / COUNT(TOTAL <Hotel> DISTINCT ID)

sunny_talwar

There also an issue for DISTINCT in numerator and not in denominator

Colin-Albert

Your right Sunny, the position of the DISTINCT is incorrect

COUNT(DISTINCT ID) / COUNT(DISTINCT TOTAL <Hotel> ID)

sunny_talwar

My bad, I didn't see that it was there .

Does the position really matter?

Colin-Albert

Not sure if the position is critical, but the expression help does show DISTINCT before TOTAL.

Not applicable
Author

That did not work. Still did not equate to 100% on each pie chart in the trellis chart.