Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problems with a wild map script

Hello,

I am using the following script to try and create a table to evaluate a dimension in my table with descriptions and assign a flag value accordingly:

wildmap3:

load *,

rowno() as Label4;

LOAD * INLINE [

Key3, Label3

'*Efectivo*',Bancos

'*cheque*',Bancos

'*PUE*',Bancos

'*PDD*',Clientes

'*Parcial*',Clientes

'*credito*',Clientes

];


SET vMapKey3=; // Initialize variable

SET vMapLabel4=; // Initialize variable

SET comma3=; // Initialize variable

SET esc3 = chr(01); // The character we will use to escape quotes


// Loop through the rows of the wildmatch table to build the expression string,

FOR i = 0 to NoOfRows('wildmap3')-1

LET vMapKey3 = vMapKey3 & comma3 & $(esc3) & peek('Key3', b, 'wildmap3') & $(esc3);

LET vMapLabel4 = vMapLabel4 & comma3 & $(esc3) & peek('Label3', b, 'wildmap4') & $(esc3);

SET comma3 = ','; // Next time through the loop, insert a comma

NEXT i


SET i=; // Drop unneeded variable

SET comma3=; // Drop unneeded variable

// For this example, I'm going to keep the wildmatch table for illustrative purposes on the Sheet.

//DROP TABLE wildmap;    // Drop the wildmatch table -- don't need it anymore


// Combine the key and label values, replacing the $(esc) char with real quotes, to build the expression

LET vMapExpr3 = replace('pick(wildMatch($1,$(vMapKey2)), $(vMapLabel3))', $(esc2), chr(39));

SET vMapKey3=; // Drop unneeded variable

SET vMapLabel4=; // Drop unneeded variable

SET esc3=; // Drop unneeded variable

I have used this before, and it seems ok, but I keep getting this error:

Script line error:

LET vMapExpr3 = replace('pick(wildMatch($1,), )', , chr(39))

does anyone has an idea of how to fix this?

Thnak you.

1 Solution

Accepted Solutions
olivierrobin
Specialist III
Specialist III

hello

where are the following variables initiaized ?

vMapKey2, vMapLabel3,esc2

i don't see them in your script

View solution in original post

2 Replies
olivierrobin
Specialist III
Specialist III

hello

where are the following variables initiaized ?

vMapKey2, vMapLabel3,esc2

i don't see them in your script

Anonymous
Not applicable
Author

Yep that was the error, thank you.