Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ananyaghosh
Creator III
Creator III

Need help for an expression

Hi,

For the fllowing expression;

if ([Product Type Code] = 'IN', 'MF', 'LS', [Social Code Group] = 'RET','DCIO','Non-DCIO')

I have used in an dimension for the condition is that: if the product type code is in 'IN', 'MF', 'LS', then [Social Code Group] field values will be in 'RET','DCIO','Non-DCIO'.

Please give me the correct syntax of expression for the above condition.

Thanks,

Sandip

11 Replies
hemanthaanichet
Creator III
Creator III

Hi Sandip,

Your requirement is whenever [Product Type Code]=IN,MF,LS then [Social Code Group] = RET,DCIO,Non-DCIO

so you can use pick and match in your expression

match([Product Type Code], 'IN', 'MF', 'LS') which fetch IN, MF, LS

It will perform whenever IN MF LS comes RET DCIO Non-DCIO will appear


Try this:


pick(match([Product Type Code], 'IN', 'MF', 'LS'), 'RET','DCIO','Non-DCIO')


or

May this i think so:


if (match([Product Type Code], 'IN', 'MF', 'LS'),match([Social Code Group] , 'RET','DCIO','Non-DCIO'),[Social Code Group])


Regards

Hemanth

hemanthaanichet
Creator III
Creator III

Hi Sandip

I tired with sample data

pick and match expression is working fine

if statement is not upto desired

Attached a qvw for the reference

Regards

Hemanth