Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using applymap as a conditional in IF statement

Hi everybody,

I want to use a construction where the execution within an IF statement is determined wheter an APPLYMAP succeeds in finding a value. My script would look like this:

IF(Applymap(a,b), x=1, x=2)

However the applymap will always give a value. Either the value which is found using the APPLYMAP or the the value b. Is there a way to use the APPLYMAP statement as a boolean?

Thanks!

1 Solution

Accepted Solutions
s_uhlig
Partner - Creator
Partner - Creator

Hi,

there is also a variant with a defaultvalue. You can use something like:

if(isnull(applymap('mapname',expr,null())),1,2) as x

Regards

Sven

View solution in original post

2 Replies
s_uhlig
Partner - Creator
Partner - Creator

Hi,

there is also a variant with a defaultvalue. You can use something like:

if(isnull(applymap('mapname',expr,null())),1,2) as x

Regards

Sven

Not applicable
Author

Thanks Sven works like a charm! Except the values for 1 and 2 need to be swapped