Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Ronald
Contributor III
Contributor III

% Total stacked bar

Hi everyone,

I have a problem with calculating the % total of each stacked bar; but it must be for every month, but for the calculation I use count (Distinct {<CUST_CONT={'CONTACTS'}>} Event_ID), then the final measure could be:

count (Distinct {<CUST_CONT={'CONTACTS'}>} Event_ID)/count (TOTAL <DATE>Distinct {<CUST_CONT={'CONTACTS'}>} Event_ID)

but don´t work.

Please your help.

stackedBar2.PNG

 

Labels (1)
1 Solution

Accepted Solutions
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @Ronald, when using TOTAL you can use field names in <> to have subtotals. In your case you are showing months but subtotaling by days. I think you need to use a month field (create it as Month(DATE) in script if you need), then use it as chart dimension and subtotal by this field:

count (Distinct {<CUST_CONT={'CONTACTS'}>} Event_ID)/count (TOTAL <MONTH> Distinct {<CUST_CONT={'CONTACTS'}>} Event_ID)

JG

View solution in original post

2 Replies
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @Ronald, when using TOTAL you can use field names in <> to have subtotals. In your case you are showing months but subtotaling by days. I think you need to use a month field (create it as Month(DATE) in script if you need), then use it as chart dimension and subtotal by this field:

count (Distinct {<CUST_CONT={'CONTACTS'}>} Event_ID)/count (TOTAL <MONTH> Distinct {<CUST_CONT={'CONTACTS'}>} Event_ID)

JG

Ronald
Contributor III
Contributor III
Author

Thanks,  it works!!! great.