Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
hello
where are the following variables initiaized ?
vMapKey2, vMapLabel3,esc2
i don't see them in your script
hello
where are the following variables initiaized ?
vMapKey2, vMapLabel3,esc2
i don't see them in your script
Yep that was the error, thank you.