Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

balrajprabhu
Contributor II

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

Re: Flagging nulls while

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

3 Replies

Re: Flagging nulls while

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
Contributor

Re: Flagging nulls while

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

balrajprabhu
Contributor II

Re: Flagging null or counting nulls for calculated dim

Thank you Sunny