Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Please visit COVID-19 group to keep up the discussion. GO TO GROUP
Highlighted
Contributor

IF statement as Custom dimension

Hi,

I have a group of store locations.. I need to identify as either "Joint Venture" or "Enterprise" in my charts.

I have a custom dimension with the following expression:

=IF(StoreName = 'Derm 1' or

'Derm 3' or 'Derm 4', 'Enterprise', 'Joint Venture')


But it only picks up 'Derm 1' as  Enterprise and not the other two. What am I missing?


Thanks in advance.

Tags (1)
1 Solution

Accepted Solutions
Highlighted

Re: IF statement as Custom dimension

Try this

=If(Match(StoreName, 'Derm 1', 'Derm 3', 'Derm 4'), 'Enterprise', 'Joint Venture')

View solution in original post

11 Replies
Highlighted

Re: IF statement as Custom dimension

Try this

=If(Match(StoreName, 'Derm 1', 'Derm 3', 'Derm 4'), 'Enterprise', 'Joint Venture')

View solution in original post

Highlighted
Partner
Partner

Re: IF statement as Custom dimension

Try this:

if(match(StoreName, 'Dem 1','Dem 3','Dem 4') > 0, 'Enterprise', 'Joint Venture') as Dim1


Regards,

Patric

Highlighted
Contributor

Re: IF statement as Custom dimension

Thanks, works great.

Highlighted
Honored Contributor II

Re: IF statement as Custom dimension

Hi,

you have missed to call that field name for multiple times like below

basic if condition :

=IF(StoreName = 'Derm 1' or StoreName = 'Derm 3' or StoreName = 'Derm 2' ,'Enterprise', 'Joint Venture')


simplified if condition

if(match( StoreName , 'Derm 1' ,'Derm 3','Derm 2') ,'Enterprise', 'Joint Venture')

and if you wish to apply wildcard then try to use like below

example, if u like to search all StoreName starting with Derm* then u can define like below,

If(WildMatch(StoreName , 'Derm*'),'Enterprise', 'Joint Venture')


Thanks,Deva

Highlighted

Re: IF statement as Custom dimension

devarasu07‌ you have been all about options recently. I like it ... Always good to have multiple ways to do the same thing. Thanks for your contribution

Contributor

Re: IF statement as Custom dimension

Thanks, the wildcard will work even better.

Highlighted
Honored Contributor II

Re: IF statement as Custom dimension

Hi stalwar1

Thank you! , You're the most Inspiration for all the Qlik newbie and thanks you too for the valuable contribution.

Regards,

Deva

Highlighted
Luminary
Luminary

Re: IF statement as Custom dimension

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

Highlighted
Honored Contributor II

Re: IF statement as Custom dimension

try this as well with wild card

pick(WildMatch(StoreName , 'Derm*')+1,'Joint Venture','Enterprise')

Learning never stops.