Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
JustinDallas
Specialist III
Specialist III

Sum behaves weirdly - sample inside

Hello Folks,

While debugging another problem, I ran into something that I was unfamiliar with.  Apparently, if I have a SUM measure, with a condition set to a value that doesn't exist, Qlik will ignore it and sum over the entire field.  For instance.

PayTable:

LOAD *,

Null() AS 'payType'

;

LOAD * Inline

[

'employeeId', 'amount'

    1, 200

    1, 100

    1, 36

]

;

Now as we see, the 'payType' field is null.  But when I have this set analysis in the UI, I am left astonished.

SUM({<payType={'Foo'}>} amount)

SumthingWrong.PNG

Does anyone know why it's summing over everything? when Null() != 'Foo' ?

Any help is greatly appreciated.

1 Reply
christophebrault
Specialist
Specialist

Hi,

Add NullAsValue before your script and it's working fine.

Your field payType must not be surround by ' but " or nothing

NullAsvalue *;

PayTable: 

LOAD *,  

null() AS payType

LOAD * Inline 

'employeeId', 'amount' 

    1, 200 

    1, 100 

    1, 36 

;

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin