Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
SBartschat
New Contributor

Applymap as parameter in a Variable

Hi there,

 

iam trying to do a repetive calculation in the loadscript for several tables via a variable with Parameters in Qliksense Desktop. This works perfectly until i try to insert a parameter as Applymap:

 

The Variable:

set vGRUNDFIXBONUS1=if($1='x',

if(
isnull($2),
$3*$4,
if(
$3 > $2,
$2,
$3*$4
)
),null()
);

 

 

The call in the loadscript:

$(vGRUNDFIXBONUS1(
hat_Grundfixbonus_1,
"Grund / Fixbonus 1 Obergrenze","Grund / Fixbonus 1",
ApplyMap('Mapping_Umsatz_Haus', "GP.-Nr",0)
))

as "Result",

 

Error Message:

 

Error in expression: ApplyMap takes 2-3 parameters

 

It seems that the Parameters 'Mapping_Umsatz_Haus', "GP.-Nr",0 are not recognized by the compiler.

 

Does anyone have a solution for this problem?

 

Thank you in advance!

Labels (3)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Applymap as parameter in a Variable

Not quite. What happens is that your variable takes parameters separated by comma's. The comma's inside the Applymap function are treated as parameter separators for the variable parameters instead of for the applymap function. What you should do is apply the ApplyMap function first and put the result in a temporary field. Then use a preceding load in which you use your variable. Instead of inputting the ApplyMap function as a paramter you input the temporary field.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
MVP & Luminary
MVP & Luminary

Re: Applymap as parameter in a Variable

Not quite. What happens is that your variable takes parameters separated by comma's. The comma's inside the Applymap function are treated as parameter separators for the variable parameters instead of for the applymap function. What you should do is apply the ApplyMap function first and put the result in a temporary field. Then use a preceding load in which you use your variable. Instead of inputting the ApplyMap function as a paramter you input the temporary field.


talk is cheap, supply exceeds demand

View solution in original post

SBartschat
New Contributor

Re: Applymap as parameter in a Variable

This was the solution for my Problem.

 

Thank you very much.