Skip to main content
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
Anonymous
Not applicable

How do you wish to use this?

hemanthaanichet
Creator III
Creator III

Hi Sandip,

Try this:

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

Regards

Hemanth

Anonymous
Not applicable

if you Need to filter  [Social Code Group] in your app, you may use field Trigger to achieve

if you want e.g. a Chart to only diesplay the relevant data you may use

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

or in an Expression you may use set analysis

{<([Social Code Group]={'RET','DCIO','Non-DCIO'}>}

vinieme12
Champion III
Champion III

is this an expression or calculated dimension?

This should be your calculated dimension

if(Match([Product Type Code], 'IN', 'MF', 'LS'),[Social Code Group])

the second part should be part of your expressions in set analysis

,[Social Code Group] = {'RET','DCIO','Non-DCIO'}

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ananyaghosh
Creator III
Creator III
Author

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

So my previous expression is : if ([Social Code Group] = 'RET','DCIO','Non-DCIO')

which means field value of [Social Code Group] will only include 'RET','DCIO','Non-DCIO' and these values can be used.

Now, please tell me what will be the set expression?

ananyaghosh
Creator III
Creator III
Author

                        

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

So my previous expression is : if ([Social Code Group] = 'RET','DCIO','Non-DCIO')

which means field value of [Social Code Group] will only include 'RET','DCIO','Non-DCIO' and these values can be used.

Now, please tell me what will be the set expression? or the if statement?

your if statement does not work for me:

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

Please give me the correct ones.

ananyaghosh
Creator III
Creator III
Author

AS I am using Qliksense there is no option for calculated dimension.

Please

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

So my previous expression is : if ([Social Code Group] = 'RET','DCIO','Non-DCIO')

which means field value of [Social Code Group] will only include 'RET','DCIO','Non-DCIO' and these values can be used.

Now, please tell me the if statement if you can?

vinieme12
Champion III
Champion III

https://help.qlik.com/en-US/sense/3.1/Subsystems/Hub/Content/Dimensions/calculated-dimensions.htm

Refer the link above

use the below in dimension

=if(Match([Product Type Code], 'IN', 'MF', 'LS'),[Social Code Group])

and below should be part of set analysis in all expressions of the chart

[Social Code Group] = {'RET','DCIO','Non-DCIO'}

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
saimahasan
Partner - Creator III
Partner - Creator III

You can use this expression:

=If(Match([Product Type Code],'IN','MF','LS'),[Social Code Group])

in you dimension.