Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Total Of Columns

Hi guys

I have two columns A & B.

Column A has a total which is calculated by setting the total mode to - Expression Total

Column B has a total which is calculated by setting the total mode to - sum(textcount) of rows.

How could I use the total for column B and divide it by the total in Column A?

Thank you

1 Solution

Accepted Solutions
Not applicable
Author

Are you trying to use these outside of the chart? Column A should be pretty easy, just take whatever aggregate function you are using and add the TOTAL modifier. If it's Sum(Sales), then Sum(TOTAL Sales) will get you the expression total.

Column B is probably more complicated, because I'm assuming it uses an aggregate function other than sum, which is why you need to change the total mode. If this is the case, then the Aggr() function is needed. The Aggr() function can be a little tricky, but it should do the job. You need your original expression and also all of the dimensions in the chart. If your original expression is Count(Customers), then you would need:

Aggr(Count(Customers), Dim1, Dim2.....)


Add as many dimension fields as you have in your chart. You may need to play around with it a bit depending on your data, but Aggr() should do the trick.

View solution in original post

1 Reply
Not applicable
Author

Are you trying to use these outside of the chart? Column A should be pretty easy, just take whatever aggregate function you are using and add the TOTAL modifier. If it's Sum(Sales), then Sum(TOTAL Sales) will get you the expression total.

Column B is probably more complicated, because I'm assuming it uses an aggregate function other than sum, which is why you need to change the total mode. If this is the case, then the Aggr() function is needed. The Aggr() function can be a little tricky, but it should do the job. You need your original expression and also all of the dimensions in the chart. If your original expression is Count(Customers), then you would need:

Aggr(Count(Customers), Dim1, Dim2.....)


Add as many dimension fields as you have in your chart. You may need to play around with it a bit depending on your data, but Aggr() should do the trick.