Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am using LET statement to store some text values in script. I have used the syntax
LET vField1 = $(Field1);
when displaying values using
=$(vField1) getting a minus(-) sign.
Your early response will be highly appreciated.
Regards
Jay.
HI Jaynal,
I think because the Field1 is a field, so it will have more than 1 value in it, so the variable can not show all the values using that method.
I think you need to use concat funciton like:
set vtest = =Concat(DISTINCT Field1,',');
Thanks.
Aiolos
What is this Field1? IS this a variable or a field from a table?
To store text values i Use set rather than Let.
Can you share some sample values?
Oh hold on does the Field1 has multiple values if yes you might want to use Concat() function to get multiple values.
Hi Jaynal,
is the Field1 is field of a table or a variable earlier calculated in the script ?
if Field1 is a field of a table then u can use following code
Temp:
Load Field1 from table X;
LET vField1 = peek('Field1',0,'Temp');
HTH
Sushil
Hi Sushil,
Field1 is a field in a table with multiple values.
If I understood you correctly the syntax peek will extract value 0 and Temp from Field1.
Thank you very much. i will give it a go.
Hi Vishwarath,
Thank you very much for the quick response.
Field1 is a field in a table.
what would the syntax for SET statement?
SET vPriority_Code1 = $('PriorityMap.Priority_Code');
Is the syntax correct?
Hi Sushil,
Looks like there is issue with my syntax below.
LET vPriority_Code2 = peek('PrioirityMap.Priority_Code','P1','P2');
Hi Jaynal,
what is P1 and P2 ?
Peek function will fetch a field records from a table based on the index values of the record.
General syntax is Peek('FieldName',indexvalue,'TableName')
HTH
Sushil
Index value should be a number without quote sign
Are you looking for Multiple values or one single value from your text field?
When you say $(PriorityMap.Priority_Code) is this a variable or Field name from your Load script.
If PriorityMap.Priority_Code is your Field name you should try
SET vPriority_Code = 'PriorityMap.Priority_Code';
Then use like in your textbox
= $(vPriority_Code)
If you have multiple values you might want to add a temp table like below:
Temp:
LOAD Concat(DISTINCT PriorityMap.Priority_Code, '|') AS StringValue
Resident YoursourceTablename;
SET vString = 'PriorityMap.Priority_Code';
SET vPriority_Code = 'StringValue';
= $(vPriority_Code)
HI Jaynal,
I think because the Field1 is a field, so it will have more than 1 value in it, so the variable can not show all the values using that method.
I think you need to use concat funciton like:
set vtest = =Concat(DISTINCT Field1,',');
Thanks.
Aiolos