Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

pschwegnl
New Contributor

How to calculate with NULL values included

Hi Community,

I would like to make calculations on a table.

Sourcedata:

Table 1.PNG

I tried to make a calculated field in my load script:

(Column2+Column3) as 'CalculatedColumn'

But the output of "CalculatedColumn" is empty in my charts where Column 1 is 2.

I expected 150.000 + 0 is 150.000 and 300.000+0=300.000.

Could anyone tell me why this column is empty?

Thanks in advance.

1 Solution

Accepted Solutions
thiago_justen
Valued Contributor III

Re: How to calculate with NULL values included

Pascal,

Try this out:

In a simple table:

Dimensions: column 1, column 2 and column 3

Expression: RangeSum([column 2],[column 3])


Or

Expression: Sum([column 2]) + Sum(If(Not IsNull([column 3]),[column 3],0))


Cheers

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
3 Replies
thiago_justen
Valued Contributor III

Re: How to calculate with NULL values included

Pascal,

Try this out:

In a simple table:

Dimensions: column 1, column 2 and column 3

Expression: RangeSum([column 2],[column 3])


Or

Expression: Sum([column 2]) + Sum(If(Not IsNull([column 3]),[column 3],0))


Cheers

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
pschwegnl
New Contributor

Re: How to calculate with NULL values included

Rangesum was solution, thank you!

By the way, I did it in load script

thiago_justen
Valued Contributor III

Re: How to calculate with NULL values included

Pretty good Pascal. Happy to help you

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
Community Browser