Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
In my load i have an issue where i need to populate the previous value if the field is null.
The null in the below would need to be SHELL
In my script i am using the following but i am still getting a null.
CandC:
Set i = 01;
Do while i <51
LOAD
"Portal Order No.",
enf$(i) as Fibre,
IF(ISNULL(enc$(i)),PEEK(enc$(PreviousField)),enc$(i)) as Part,
f%$(i) as Percentage
FROM [//////////////////////////////////]
(ooxml, embedded labels, header is 1 lines, table is sheet1)
where len(enf$(i))>1
;
if i<9 then
Let i='0'&(i+1);
else
Let i=i+1;
end if;
Loop;
Please can anyone let me know what is wrong with this line?
IF(ISNULL(enc$(i)),PEEK(enc$(PreviousField)),enc$(i)) as Part,
thank you
Daniel
Hi,
I don't use many loops in my Script, but it Peek function uses the following
PEEK('Field Name', 'Row No', 'table')
So would have expected something more like
IF(ISNULL(enc$(i)),PEEK(enc$(i),-1) AS Part
Hi Mark,
Thank you so much for the quick reply, my issue is this was written for me a while back and i never got it working!
thanks for the suggestion, unfortunately the -1 is not looking right in the syntax here. see below:
Really appreciate your time here. thanks
Daniel
Hello Daniel,
The field you use in PEEK must be in output table in memory: PEEK(enc$(PreviousField))
It means you have to include enc$(PreviousField) in LOAD statement.
Besides, as Mark states, you must single-quote the field name in Peek: PEEK('enc$(PreviousField)')