Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone.
In my script now I create variable like this:
Set vVar = 'AAA', 'AAAB', 'CC','DD.FF.G>kYY';
This variable I use in the script with "Match" function.
Since I need to take values foe this variable from the particular field, I tried to do next variants, to get field values into the same variable. Unfortunately, both didn't give me any result.
First solution:
Table_1:
Load
Chr(39) & Field_1 & Chr(39) as Field_1
From Table_123;
Let noRows = NoOfRows('Table_1')-1;
For i=0 to $(noRows)
Let vVar =FieldValue('Field_1 ',$(i));
Next i
Second solution:
Table_1:
Load
Chr(39) & Field_1 & Chr(39) as Field_1
From Table_123;
Set vOBR_Assets = Peek('Field_1 ', 0, 'Table_1');
In both cases vVar is empty. Any suggestion how to solve this task?
Are you trying to get all the values from a field? If so try like:
Load
Concat(Distinct char(39) & Field_1 & chr(39), ',') as ConcatString
From <>;
Let vVar = Peek('ConcatString');
Are you trying to get all the values from a field? If so try like:
Load
Concat(Distinct char(39) & Field_1 & chr(39), ',') as ConcatString
From <>;
Let vVar = Peek('ConcatString');
Hi,
in the first solution, your variable gets overwritten with each iteration and I guess there might be more rows than actual values, so you get NULL. If you want to do it this way, you need to append the new value to old variable. Btw you don't need to create variable noRows.
In the second my guess is the extra space in 'Field_1 ' in Peek function
Tresesco, your idea it's a perfect match! Thank you for help.
David, thank you much for your advises.