Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
juntiporn_k
Partner - Contributor II
Partner - Contributor II

How to use Alt function to check whether field is null

How to use Alt function to check whether field is null or not null.

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Alt(FIELD1, FIELD2) as Result

Here if FIELD1 is Null, then you will see FIELD2, else you will see FIELD1

QlikView help on Alt: QlikView ‒ alt - script and chart function

View solution in original post

5 Replies
sunny_talwar

May be this:

Alt(FIELD1, FIELD2) as Result

Here if FIELD1 is Null, then you will see FIELD2, else you will see FIELD1

QlikView help on Alt: QlikView ‒ alt - script and chart function

nancypoliti
Contributor II
Contributor II

This is only true for fields with NUMBERS. If Field1 is a non null string, Field2 will be returned.

sunny_talwar

Thanks for pointing that out . I always thought that it works for number and text, but it seems to be something which can be used for numbers only.

nancypoliti
Contributor II
Contributor II

Yes, I lost 4 hours of my life to this, thinking that it worked on strings as well as numbers.

Alt(Field1, Field2, Field3, ...) will return the first valid NUMERIC value from the list in the parentheses. It's dangerous to think of it as just a test for NULL.

Anonymous
Not applicable

i have Ten employee Id. but 6 employees only present today. 4 employees not present.  i want to 10 employees worked hours, here 6 employees based on working hours and 4 employees set 0? how to do