Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
qvqfqlik
Creator
Creator

Sum of fields

How to calculate sum of two different fields from two different fields -

sum needs to be calculated in the third table.

field 1  - is sum(x+y+z) as field1

fields 2 - is sum (a+b+c) as field2

in another table i need to calculate field3 which would be field1+field2

Please help

13 Replies
sunny_talwar

You will need to somehow bring all the fields in one table to do this in the script. To bring them together, you can do join, mapping or lookup

MK_QSL
MVP
MVP

Better if you can provide a sample document or your data model. screenshot.

qvqfqlik
Creator
Creator
Author

attached file to original post

look into "ChangeHere" tab - for now I fixed it in the table name "Working" - I commented it for now , so that you can take a look

but I actually need to make it work using tables "Current" , "Two"  - and calculate Field_1  from "Current" table, Field_2 from "Two" table.

And calculate  Sum in the other table.

Please take a look

qvqfqlik
Creator
Creator
Author

attached file to original post

look into "ChangeHere" tab - for now I fixed it in the table name "Working" - I commented it for now , so that you can take a look

but I actually need to make it work using tables "Current" , "Two"  - and calculate Field_1  from "Current" table, Field_2 from "Two" table.

And calculate  Sum in the other table.

Please take a look

qvqfqlik
Creator
Creator
Author

attached file to original post

look into "ChangeHere" tab - for now I fixed it in the table name "Working" - I commented it for now , so that you can take a look

but I actually need to make it work using tables "Current" , "Two"  - and calculate Field_1  from "Current" table, Field_2 from "Two" table.

And calculate  Sum in the other table.

Please take a look

qvqfqlik
Creator
Creator
Author

I'm bringing all the fields by concatenating table "current" and table "two"


But somehow in the final table I'm not getting any values 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Instead of the "+" operator, use the RangeSum() function to sum multiple fields. See if that makes a difference in your case.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

qvqfqlik
Creator
Creator
Author

Thankyou Rob!

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Did RangeSum() fix the problem?

-Rob

http://masterssummit.com

http://qlikviewcookbook.com