Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
bharatkishore
Creator III
Creator III

if statement

Hi All,

I am writing the below if condition,

if(IsNull(Modality),'Null Modality',Modality),

          if(IsNull(District),'Null District',District),

               if(IsNull(Norm),'No Norm',Norm) as comment

Can you please help me bec the else condition is not passing is it because  i am closing the brace at Modality and Distrcit.

Thanks,

Bharat

18 Replies
bharatkishore
Creator III
Creator III
Author

Yes Ishtdeep..

isingh30
Specialist
Specialist

if(Modality = 0,'Null Modality','Modality' and

          if(District = 0,'Null District','District' and

               if(Norm = 0,'No Norm','Norm')))

bharatkishore
Creator III
Creator III
Author

Hi Vijay,

I am trying to acheive if (condition , then ,else then lf else) is it possible or is there any way.. can you please tell me

bharatkishore
Creator III
Creator III
Author

thanks ishtdeep but is there any chance that i can include o as isnull. And should be in else part

vvira1316
Specialist II
Specialist II

can you please explain your need in words with your sample data rather than with if statement you have provided.

Please advise what is the output expected from your data and we can try to provide you the syntax. Are you trying to do in script or in chart?

bharatkishore
Creator III
Creator III
Author

Hope this will help:

case when Modality is NULL then 'NULL Modality'

when District  is NULL then 'NULL District'

when (Norm is NULL or Norm = 0) then 'NO norm'

else 'Include' end as comment

vvira1316
Specialist II
Specialist II

In above case statement you don't have if Modality is null then "'Null Modality" else value of field Modality and then you were checking for District and Norm in the statement to come up with Comment field like you have in original question.

Try following

If(IsNull(Modality), 'NULL Modality',

If(IsNull(District), 'NULL District',

If((IsNull(Norm) or Norm='0'), 'NO Norm', 'Include'))) as Comment

bharatkishore
Creator III
Creator III
Author

Will this script anything will help?

case when Modality is NULL then 'NULL Modality'

when District  is NULL then 'NULL District'

when (Norm is NULL or Norm = 0) then 'NO norm'

else 'Include' end as comment


i need to write in qlikview

bharatkishore
Creator III
Creator III
Author

Thank you..