Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Set Analyis to replace isnull

I have been on a crusade to eliminate if statements in expressions.

I have the below statement that I don't know if Set would help.

If anyone has thoughts I would appreciate it.

Sum ([ A ]) - sum(if(IsNull([ B] ),[ C ],[ B ]))

Basically this subtracts B from A unless B is null then is uses C

Tags (1)
1 Reply
Not applicable

AW:Set Analyis to replace isnull

Hi pshicks,

I tried this:

(isnull(B)*-1)*C + (isnull(B)+1)*B

But if B is null you can't calculate with it: x+null = null

You only can calculate with independent Values:

(isnull(A)*-1)*C + (isnull(A)+1)*B

This means if A is Null sum(C) else sum(B)

Have Fun

AlexSmiley Happy

Community Browser