Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Users, make your voice heard! Participate in Wisdom of Crowds® Market Study: Start Survey
cancel
Showing results for 
Search instead for 
Did you mean: 
akuttler
Creator
Creator

Nested IF as Dimension

Hello,

I have the following Dimension:

=IF(WildMatch ([LINE_ITEM_ADJUSTMENTS], '*CO-107*',

), 'Registration Error')

Can I write this expression to include multiple if wild match conditions?

Such as:

=IF(WildMatch([LINE_ITEM_ADJUSTMENTS], '*CO-107*','Registration Error'),

IF(WildMatch([LINE_ITEM_ADJUSTMENTS], '*CO-24^*', 'Captation')))

Thanks in advance.

6 Replies
gmoraleswit
Partner
Partner

Try

Pick(WildMatch ([LINE_ITEM_ADJUSTMENTS], '*CO-107*', '*CO-24^*'), 'Registration Error', 'Captation')

Regards!

akuttler
Creator
Creator

I have about 25 categories to assign, so it needs to be like nested if statements.

akuttler
Creator
Creator

And there could be multiple categories to each row.

gmoraleswit
Partner
Partner

if the expression I sent works with 2 it can work with as many as you want

Pick(WildMatch ([LINE_ITEM_ADJUSTMENTS], '*CO-107*', '*CO-24^*','cat3*','cat4', etc...), 'Registration Error', 'Captation','Category 3','Category 4',etc.)

akuttler
Creator
Creator

What if the categories have multiple wild match criteria?

gmoraleswit
Partner
Partner

You can do something like this:

Pick(WildMatch ([LINE_ITEM_ADJUSTMENTS], '*CO-107*', '*CO-24^*','criteria3.1*','criteria3.2*','cat4', etc...), 'Registration Error', 'Captation','Category 3','Category 3','Category 4',etc.)


If you don't want to create a long calculated dimension you can use the same in the script or try to use a mappping/applymap depending in how many diferent criteria values you have.