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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to total columns rather than the row total

If the amounts  in a column are calculated  from other columns , how to you add the column rather than have it calculated by the totals fro other columns.

Example 

    

A          B          C         D           E            F         G
114,500.0030.54%4,428.937,250.00-2,821.07
2142,500.0077.11%109,885.7799,120.00 10,765.77
32,006,505.0062.64%1,256,841.821,307,905.00-51,063.18
4301,905.9990.00%271,716.56272,605.99-889.43
5135,449.662.21%2,999.290.00 2,999.29
Total2,600,860.6562.01%1,612,731.611,686,880.99-74,149.38

 

Column D is 30.54% of Column B
Column  D Minus Column E, if Negative = F
Column  D Minus Column E, if Positive  = G
Note Issues with Total.
Need to Add Columns F  and G not Calculated Total of D Minus E
1 Solution

Accepted Solutions
swuehl
MVP
MVP

I guess you want to have sum-of-rows total mode instead expression total for the last to columns, right?

In a straight table chart, you can change the total mode on expression tab for each expression, change it to sum of rows.

In a pivot table chart, always 'expression total' total mode will be used.

But you can emulate a sum-of-rows total mode in a pivot table using advanced aggregation (there is a chapter in the HELP about this, too).

It may looke like

=Sum(Aggr( YourExpression, YourChartDimensionFieldsCommaSeparated))

in your example maybe like for column F

=Sum(Aggr( If(B*C-E<0, B*C-E), A))

View solution in original post

3 Replies
oknotsen
Master III
Master III

You can use the names of the columns in expressions or refer to them with the column() function.

So you could do....

column(6) + column(7)

Will that solve it for you?

If not, can you give a more clear example?

May you live in interesting times!
Anonymous
Not applicable
Author

Could you please elaborate ??

Need to Add Columns F  and G not Calculated Total of D Minus E ?

You want  to add F and G columns ?

swuehl
MVP
MVP

I guess you want to have sum-of-rows total mode instead expression total for the last to columns, right?

In a straight table chart, you can change the total mode on expression tab for each expression, change it to sum of rows.

In a pivot table chart, always 'expression total' total mode will be used.

But you can emulate a sum-of-rows total mode in a pivot table using advanced aggregation (there is a chapter in the HELP about this, too).

It may looke like

=Sum(Aggr( YourExpression, YourChartDimensionFieldsCommaSeparated))

in your example maybe like for column F

=Sum(Aggr( If(B*C-E<0, B*C-E), A))