Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

qlikbuggi
New Contributor

Decoding Flag values

I am new to Qlikview.


How can I decode the Y,N and null values from a flag field to meaningful text .So that,user can select the required text

Example:

Condition

if food_flag IN ('Y') then 'fruits'

If food_flag IN ('Y','N')  then 'fruits and veg'

else 'other food'

could you please provide the syntax to write in expression for the bove condition.

Tags (3)
3 Replies
Not applicable

Re: Decoding Flag values

Hi,

It is difficult to make the above condition in a selection box,  because you have non-exclusive grouping.

In alternative you can have (either in the calculated dimension or in the script):

if(flood_flag='Y','fruits',if(flood_flag='N','veg','other food'))


Qlikview will perform better and allow you to select multiple values easily, to combine fruit and vegetables.

If you really need to have that unconventional group you can create buttons that make selections.In the button (label it 'fruit and veg') and set the action to select value 'Y' on the filed flood_flag and another action to select value 'N'.

I hope this helps.

Kind regards,

Nuno

amarbogam
Contributor

Re: Decoding Flag values

Maybe you can write something like this as well..just an idea..you might have to make it dynamic..

Table1:

Load

'Fruits' as Type

where food_flag ='Y'

concatenate

Load

'fruits and veg' as Type

where food_flag ='Y'

concatenate

Load

'fruits and veg' as Type

where food_flag ='N'

Thanks,

qlikbuggi
New Contributor

Re: Decoding Flag values

Thank you so much for your response

Community Browser