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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Giansonn
Creator
Creator

How to add a total amount for a stacked bar graph with a filter applied

Dear Community,

 

I am trying to create a 100% stacked table column.

Usually I will create a measure like this:

count(item)/count(total <date> item)

In order to get a percentage of the total as a measure.

 

Now I would like to make the same type of chart for a specific segment. My code so far is:

count({$< segment= {'A'}>} item)/count(total <stock_date, ???> item)

 

However as you might see I have not applied the same filter to the total calculation (the denominator) instead I have put ??? because I do not know what how syntax is written. Can anyone help?

 

I have tried:

count({$< segment= {'A'}>} item)/count(total <stock_date, segment= {'A'}> item)

But this does not work.

Labels (1)
1 Solution

Accepted Solutions
Giansonn
Creator
Creator
Author

I have the answer I needed to put the filter context before the total

 

count({$< segment= {'A'}>} item)/count({$< segment= {'A'}>} total <stock_date> item)

View solution in original post

1 Reply
Giansonn
Creator
Creator
Author

I have the answer I needed to put the filter context before the total

 

count({$< segment= {'A'}>} item)/count({$< segment= {'A'}>} total <stock_date> item)