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

How to add numbers ?

I have field A and field B, both contain numbers ($numeric $integer in the data model). I want a field C that contains the value of A + B, so in my data load script I wrote A + B as C, but all I get are " - " values in my C field.

What am I doing wrong ?

1 Solution

Accepted Solutions
sunny_talwar

Did one of the two fields have null value when you saw '-' for C? '+' is not able to handle 5 + Null and results in null. Try using RangeSum()....

RangeSum(A, B) as C

View solution in original post

4 Replies
sunny_talwar

Did one of the two fields have null value when you saw '-' for C? '+' is not able to handle 5 + Null and results in null. Try using RangeSum()....

RangeSum(A, B) as C
Saryk
Partner - Creator II
Partner - Creator II
Author

Thank you sir, it does work properly now.

I indeed had " - " values in my fields, as A and B usually are mutually exclusive.

Saryk
Partner - Creator II
Partner - Creator II
Author

Spoiler
As a follow-up, can I make a pie chart with A + B and have a filter for A and B ? I'm currently showing C, but if I want to have only A or only B, how can I do that ?
sunny_talwar

It might be easier to transform your data using CrossTable load and then using it in your chart to do this.