Skip to main content
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 - Creator II
Partner - Creator II

Try

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

Regards!

akuttler
Creator
Creator
Author

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

akuttler
Creator
Creator
Author

And there could be multiple categories to each row.

gmoraleswit
Partner - Creator II
Partner - Creator II

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
Author

What if the categories have multiple wild match criteria?

gmoraleswit
Partner - Creator II
Partner - Creator II

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.