Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

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
Highlighted
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
Highlighted
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

Highlighted
Contributor II
Contributor II

Yep that was the error, thank you.