Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Flagging null or counting nulls for calculated dim

I'm creating a calculated dimension in the script editor

Let say I have a field called RateVale with the values A,B,C,D,null()

I want to create a calculated field called Picked with 2 values in it Yes and NO based on the following condions

if RateVale =A,B or Null() then Picked is Yes else 'NO'

I'm tryinng something like

if(match (RateVal,'','',null()),'Yes','No') as Picked

will the above code work?I'm not sure if it will pcik nulls,should I use len(trim(Ratevale)) instead of  null()

Thanks

B

1 Solution

Accepted Solutions
sunny_talwar

Can you may be create a flag in the script like this:

If(Len(Trim(RateVale)) = 0, 'Yes',

If(Match(RateVale, 'A', 'B'), 'Yes', 'No')) as Picked

or

If(Len(Trim(RateVale)) = 0, 'Yes' or Match(RateVale, 'A', 'B'), 'Yes', 'No') as Picked

or

If(Match(RateVale, 'D'), 'No', 'Yes') as Picked

View solution in original post

3 Replies
sunny_talwar

Can you may be create a flag in the script like this:

If(Len(Trim(RateVale)) = 0, 'Yes',

If(Match(RateVale, 'A', 'B'), 'Yes', 'No')) as Picked

or

If(Len(Trim(RateVale)) = 0, 'Yes' or Match(RateVale, 'A', 'B'), 'Yes', 'No') as Picked

or

If(Match(RateVale, 'D'), 'No', 'Yes') as Picked

pooja_sn
Creator
Creator

if ( match( RateValue ,'A','B') or IsNull(RateValue) ,'Yes' , 'No') as Picked

Anonymous
Not applicable
Author

Thank you Sunny