Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
HPW
Contributor II
Contributor II

Sum with formular in table

Hi,

In QlikView there was the opportunity in tables to choose for sums with formulars (like 'if(sum(price*unit)>0,sum(price*unit),0)')  between a sum of each single line or of using the formular also for totals.

In Qlik Sense I have no idea how to get the sum for all single lines. With the normal setting in the total the formular is used.

Is it possible to get a sum for a values with a positiv 'price*unit' in a Qlik Sense table?

Best regards

Hans-Peter

Labels (2)
1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi
you can get it using an aggr function 
sum(aggr( if(sum(price*unit)>0,sum(price*unit),0),dimension))
instead of the dimension placeholder in the expression above,  you should use the list of dimensions used in the table separated by a comma.
Another option is to have a look at using the vizlib table. It offers the sum of rows option built-in.

View solution in original post

1 Reply
lironbaram
Partner - Master III
Partner - Master III

hi
you can get it using an aggr function 
sum(aggr( if(sum(price*unit)>0,sum(price*unit),0),dimension))
instead of the dimension placeholder in the expression above,  you should use the list of dimensions used in the table separated by a comma.
Another option is to have a look at using the vizlib table. It offers the sum of rows option built-in.