Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
kakani87
Specialist
Specialist

Display a string when two fields are null

Hi Folks ...

Here I want to show In a chart the status based on two fields all the status able to show with the below expression but when two fields they are Null I would like to show as 'Abscent'

here in my case this is showing as third scenario as 'OnSite'

Can any one correct the syntax when both the fields they are null show as 'Abscent'

if(column(1)<column(2),'ProperEntry',

if(column(1)>column(2),'RemoteEntry',

if(IsNull(column(1)),'OnSite',

if(IsNull(column(2)),'Missing',

if(IsNull(column(1) and column(2)) ,'Abscent'

//if(IsNull(column(1)) and IsNull(column(2)) ,'Abscent'

)

)

)

)

)

Regards,

Kishore.

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi SaiKishore,

if(column(1)<column(2),'ProperEntry',

if(column(1)>column(2),'RemoteEntry',

if(IsNull(column(1)) and IsNull(column(2)) ,'Abscent',

if(IsNull(column(1)),'OnSite',

if(IsNull(column(2)),'Missing'

)

)

)

)

)

View solution in original post

6 Replies
tamilarasu
Champion
Champion

Hi SaiKishore,

if(column(1)<column(2),'ProperEntry',

if(column(1)>column(2),'RemoteEntry',

if(IsNull(column(1)) and IsNull(column(2)) ,'Abscent',

if(IsNull(column(1)),'OnSite',

if(IsNull(column(2)),'Missing'

)

)

)

)

)

kakani87
Specialist
Specialist
Author

Thanks a lot this worked.

But the same i entered in the post with line commented

Where I went wrong

//if(IsNull(column(1)) and IsNull(column(2)) ,'Abscent'

kakani87
Specialist
Specialist
Author

Can we provide a filter for all the Status displayed

Inorder to filter Each status

     Status:

  1. ProperEntry
  2. RemoteEntry
  3. OnSite
  4. Missing
  5. Abscent
tamilarasu
Champion
Champion

if(column(1)<column(2),'ProperEntry',

if(column(1)>column(2),'RemoteEntry',

if(IsNull(column(1)),'OnSite',

if(IsNull(column(2)),'Missing',

if(IsNull(column(1) and column(2)) ,'Abscent'

//if(IsNull(column(1)) and IsNull(column(2)) ,'Abscent'

)

)

)

)

)

The reason is the third condition is true in your if condition, so the next if conditions will not be considered. It is checking only the column(1) and it is null so it is returning "OnSite" and else part not considered.

tamilarasu
Champion
Champion

Listbox filter?

kakani87
Specialist
Specialist
Author

Yes Tamil.