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

How to move sum of rows from straight table into a textbox

Hi,

I am trying to move sum of rows from straight table into a text box. Below is the straight table.


straight table.jpg

Below is the dimension for tax code:

=if(TAX_CODE_src_1 = 'O1' or TAX_CODE_src_1 = 'OA' or TAX_CODE_src_1 = 'OB' or TAX_CODE_src_1 = 'OD' or TAX_CODE_src_1 = 'ON' or

TAX_CODE_src_1 = 'OP' or TAX_CODE_src_1 = 'I4S' or TAX_CODE_src_1 = 'I6S', TAX_CODE_src_1)

and I have ticked the button, Suppress When Value is null which will exclude the tax codes not listed above in the dimensions.

Chart properties.JPG

Below is expression:

=sum(AMT_TAX_TAXREP_A_src_1).

Appreciate assistance on this - as I need to move the sum of the expression into a textbox.


Thanks.

Carlson

1 Solution

Accepted Solutions
sunny_talwar

Do you have set the total mode to sum of rows on the expression tab? If yes then try adding Aggr() function around your expression as well:

Sum(Aggr(Sum({<TAX_CODE_src_1 ={'O1','OA','OB','OD','ON','OP','I4S','I6S'}>}  AMT_TAX_TAXREP_A_src_1), TAX_CODE_sc_1))

and I would recommend using Balraj's expression for your straight table as well instead of using a calculated dimension because calculated dimension takes more resources and set analysis is a more efficient way of doing the same thing you are doing above.

View solution in original post

3 Replies
Anonymous
Not applicable
Author

try this?


=sum({<TAX_CODE_src_1 ={'O1','OA','OB','OD','ON','OP','I4S','I6S'}>}  AMT_TAX_TAXREP_A_src_1)

Anonymous
Not applicable
Author

Hi,

In the textbox, write =sum(if(TAX_CODE_src_1 = 'O1' or TAX_CODE_src_1 = 'OA' or TAX_CODE_src_1 = 'OB' or                                                  TAX_CODE_src_1 = 'OD' or TAX_CODE_src_1 = 'ON' or TAX_CODE_src_1 = 'OP' or                                                        TAX_CODE_src_1 = 'I4S' or TAX_CODE_src_1 = 'I6S', TAX_CODE_src_1

                                             )  AMT_TAX_TAXREP_A_src_1

                                        )

sunny_talwar

Do you have set the total mode to sum of rows on the expression tab? If yes then try adding Aggr() function around your expression as well:

Sum(Aggr(Sum({<TAX_CODE_src_1 ={'O1','OA','OB','OD','ON','OP','I4S','I6S'}>}  AMT_TAX_TAXREP_A_src_1), TAX_CODE_sc_1))

and I would recommend using Balraj's expression for your straight table as well instead of using a calculated dimension because calculated dimension takes more resources and set analysis is a more efficient way of doing the same thing you are doing above.