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

Using Total of Column in an Expression

Hi,

  I have a straight table with a total column that is calculated with the following expression:

Column (3) + Column (4) + Column (5). I attached the straight table. I am trying to add one more column that uses the Total of the calculated column divide by the total of the line. This would give a percentage of the total. Example:

1623919.8 / 9391684.39 * 100 = 17.29%

301618.59 / 9391684.39 * 100 = 3.2 %

etc.

The issue I am having is getting the total of the column(9391684) in my expression. Any ideas? Seemed simple but I am missing something.

5 Replies
martin59
Specialist II
Specialist II

Hi Dick,

What is the expression of your sixth column ?

You have to add the TOTAL keyword to obtain the result.

For exemple, if your expression is sum(TurnOver) for the 6th column.

You just have to write something like this

(Column (3) + Column (4) + Column (5)) / Sum(TOTAL TurnOver) *100


Hope that helps you


Martin Favier

Not applicable

Hi,

Hope this is what you are looking for.

Please take a look at the Expression '%'. I have used sum as an example. Hope it works for your case as well.

Let me know if it doesn't meet your needs.

Thanks

AJ

dthornburg
Contributor II
Contributor II
Author

Hi,

  Neither one of these are giving me a result.

Current calculation is below just trying to simplify :

Column (6) / sum(total E)

6th Column calculation is - Column (3) + Column (4) + Column (5).

I do have the Totals printing at the top. They are in bold. I want to use that total of column 6 in the calculation.

Thanks for the quick response.

preminqlik
Specialist II
Specialist II

hi Duck ,

Try this

(column(1)+Column(2)+Column(3))sum(total aggr((column(1)+Column(2)+Column(3)),Dimension1,Dimension2)

try this and let me know , if not getting try using each and every column by aggr()

martin59
Specialist II
Specialist II

Hi Dick,

Could you send us a sample of your QV app or your expression for the sixth column ?

Thanks in advance,

Martin Favier