Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
Mattia
Creator II
Creator II

If statement with NOT NULL

Hi guys,

i need to modifiy the following expression, because it don't works.

If(Len(Trim([@183:190]<>'')), Mid([@183:190],3,2), Mid([@18:25],3,2))

The output i want is that If(Len(Trim([@183:190] IS NOT NULL, i must see Mid([@183:190],3,2), otherwise Mid([@18:25],3,2).

Please, someone can help me?

Thanks,

Mattia

 

Labels (3)
1 Solution

Accepted Solutions
Yousef_Amarneh
Partner
Partner

I don't know why you are using len(), however, if you want to check if the field is null or not better to use isnull() fundtion

 

If(Trim([@183:190])='' or IsNull([@183:190]), Mid([@18:25],3,2),Mid([@183:190],3,2))

Yousef Amarneh

View solution in original post

3 Replies
Yousef_Amarneh
Partner
Partner

I don't know why you are using len(), however, if you want to check if the field is null or not better to use isnull() fundtion

 

If(Trim([@183:190])='' or IsNull([@183:190]), Mid([@18:25],3,2),Mid([@183:190],3,2))

Yousef Amarneh

View solution in original post

Mattia
Creator II
Creator II

Thx Yousef!!!

Now it works perfectly.

Mattia

sunny_talwar

You can also try

If(Len(Trim([@183:190])) > 0, Mid([@183:190], 3, 2), Mid([@18:25], 3, 2))