Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

NULLIF in QlikView?

I'm missing the SQL "NULLIF" command when scripting. Looking for alternatives. Any suggestions?

Thanks /Joakim



sum

(isnull(oru.ordlevantal,0)* isnull(nullif(orp.artvikt,0),isnull(ar.artbtotvikt,0)))



1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Issue resolved - using rangeMAX ¨

//Joakim

View solution in original post

4 Replies
hector
Specialist
Specialist

Hi

you can use rangesum()

rangesum(NULL) = 0

rangesum('A') = 0

rangesum(null,3) = 3

Or maybe use alt()

Check the help for more examples

Rgds

Anonymous
Not applicable
Author

Thanks Héctor! I'll check it out //Joakim

Anonymous
Not applicable
Author

Ok, so I was a bit fast to answer that it acctually worked.



SQL Example - isnull ( nullif ( table1.weight , 0 ) , isnull ( table2.weight , 0 ) )

I m looking for the weight in table1. If the weight is NULL or 0(zero) I'd like to go to table2 to look for the weight there - This effect I get by making the value NULL in table1 if it acctually is 0 - The ISNULL statement then looks in table2.

If the value is NOT NULL or 0 (zero) I do NOT want to go to table2

RANGESUM(2 KG,1 KG ) = 3KG - Expected result 2KG

I words - If it finds the weight in table1 I want it to disregard of whatever value it can find in table 2 - This is also done by the first ISNULL satement

Understandable?

Thanks / Joakim

Anonymous
Not applicable
Author

Issue resolved - using rangeMAX ¨

//Joakim