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

How to write an expression with not null value

I want to write an expression for a field in database which is reflected in qlikview as ACTUAL ROB

.Example when this field is updated in database or is non empty, I can say that the Status is edited.

What would be my expression for this?

if(( ACTUAL ROB is not null ,'Correction done','Correction not done')

OR IF THE VALUE FOR THIS FIELD IS MISSING OR EMPTY I CAN WRITE THE FOLLOWINGß

if(( ACTUAL ROB is null OR MISSING ,'Correction NOT done','Correction  done')

The data format for ACTUAL ROB is Integer and not varchar

1 Solution

Accepted Solutions
olivierrobin
Specialist III
Specialist III

hello

in Qlik, you could try

if( len(trim([ACTUAL ROB]))=0 ,'Correction NOT done','Correction  done')

View solution in original post

8 Replies
olivierrobin
Specialist III
Specialist III

hello

in Qlik, you could try

if( len(trim([ACTUAL ROB]))=0 ,'Correction NOT done','Correction  done')

trishita
Creator III
Creator III
Author

we don't have to use the IsNull or Exist field? Suppose the field has a value 0 then it would be noted as null or 0?

trishita
Creator III
Creator III
Author

Actual ROB is not a string ..Is it okay this code then

if( len(trim([ACTUAL ROB]))=0 ,'Correction NOT done','Correction  done')?

YoussefBelloum
Champion
Champion

len(trim()) works with all null/blanks etc.. it will not work if you have 0, 0 is not null and is not blank

if you want to consider 0 values as null, you can replace those 0 to null in the script and then use the len(trim()) technique

trishita
Creator III
Creator III
Author

Hi Its working.

Can you also suggest how to colour the correction done and correction not done statements using colour functions

olivierrobin
Specialist III
Specialist III

in your graph, you can use an expression in foreground color section

eg:

if(field='Correction done'),blue(),red())

olivierrobin
Specialist III
Specialist III

oups !!!!!

in text color section

trishita
Creator III
Creator III
Author

I WANT TO KEEP ZEROES (any value in the field) as it is to be considered for the requirement..If the field has no value it is implied that the corrections are not done.