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: 
anuradhaa
Partner - Creator II
Partner - Creator II

Sum doesn't work in Straight Table

I'm using view to load data.

it has two colums in number data type.

After load the data i use above two columns to add them together in expression. but some records were not available in the grid.

ex- when id = 120, both columns has ' 0 ' data that records is not available.

6 Replies
Anil_Babu_Samineni

May be use RanguSum(Column1, Column2)

Or you should show data and expected result

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
anuradhaa
Partner - Creator II
Partner - Creator II
Author

I found the issue,

I use Val1 + Val 2 in my expression,

use if((Val1 + Val 2)>0,(Val1 + Val 2),'0.00').

but when i use this, that raw doesn't show.

but use if((Val1 + Val 2)>0,(Val1 + Val 2),'www').

it shows 'www' when val1 and val2 is 0.

Val1 + Val 2 also don't show any record

jonathandienst
Partner - Champion III
Partner - Champion III

Not sure if I understand your issue, but I think what you need is this expression:

=RangeMax(RangeSum(Val1, Val2), 0)

The RangeSum ensures that a null value in either field does not result in a null result. The RangeMax replaces your If() and returns only the positive values.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
gerry_hdm
Creator II
Creator II

In the table

sum( rangesum(VAr1,Var2)

or In the script

rangesum(VAr1,Var2) as #nameSumVAr

and then in Table

sum(#nameSumVAr)

Gruß gerold

Siva_Sankar
Master II
Master II

Anuradha,

Not sure if i understand your issue correctly, if you are talking about total row at the bottom..check if you enabled Sum of Rows instead of Expression Total under the Expression tab.

Total Mode.JPG

Anil_Babu_Samineni

but use if((Val1 + Val 2)>0,(Val1 + Val 2),'www').

it shows 'www' when val1 and val2 is 0.

Because, Here you are taking only o above data. If you want to calculate with 0 then expression should this

if((Val1 + Val 2)>=0,(Val1 + Val 2),'www')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful