Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
Contributor

Re: Using applymap as a conditional in IF statement

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

2 Replies
s_uhlig
Contributor

Re: Using applymap as a conditional in IF statement

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

Re: Using applymap as a conditional in IF statement

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

Community Browser