Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
i want to store value of load statement in a variable. is it possible?
i have a excel file with values below:
item rate
coe 0.23
cog 0.50
i want to store in a variable like below:
let rate= load rate from excelfile where item='coe';
and rate variable should give value as 0.23
please advise with right steps
thanks
tmpTable:
LOAD
item,
rate
FROM ...
WHERE item = 'coe'
;
LET vRate = PEEK('rate',-1,'tmpTable')
DROP TABLE tmpTable;
Hi,
use peek function
EX: let rate=peek( 'FieldName', 0, 'TableName' )
let rate = peek(load rate from excelfile where item='coe');
like this
??
Hi,
you can assign lookup function value as your variable value. Take a look into definition of lookup function in Reference Manual.
regards
Hi,
First read in peek function in help. See the below syntex.(Single quotes must)
EX: let rate=peek( 'FieldName', 0, 'TableName' )
FieldName = Finding field name
TableName= Finding table name
Hi,
Please correct me .
You wanted to maintain Data in Excel and from that you need to fetch particular row with the some conidition and then you want to assign it to Varaible .
What i can suggest is that you can maitain the Variable directly in the Excel sheet .
So if you want to change value you can cahnge in the Excel itself instead of changing the value in thescript .
Regards
Yusuf
tmpTable:
LOAD
item,
rate
FROM ...
WHERE item = 'coe'
;
LET vRate = PEEK('rate',-1,'tmpTable')
DROP TABLE tmpTable;