Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
tablename:
LOAD
@1 as callid,
@2 as acwtime,
@3 as ansholdtime,
@4 as consulttime,
@5 as disptime,
@6 as duration,
@7 as segstart
FROM
[$(vFilePath)]
where @7>peek('@7',-1,'table name')
(txt, codepage is 1252, no labels, delimiter is ',', msq);
when i am trying to update the table based on the @7>peek('@7',-1,'table name') peek function its not working fine.
segstart contains date and time.
please help me.
Thanks,
Hi,
Try to load a table and find the last value and store it in variable with Peek function
tablename:
LOAD
@1 as callid,
@2 as acwtime,
@3 as ansholdtime,
@4 as consulttime,
@5 as disptime,
@6 as duration,
@7 as segstart
FROM
[$(vFilePath)]
(ooxml, embedded labels, table is Sheet1);
Let Last = peek('@7',-1,'table name');
TRACE $(Last);
DROP Table [table name];
NewLoad:
LOAD
callid,
acwtime,
ansholdtime,
consulttime,
disptime,
duration,
segstart
FROM
(ooxml, embedded labels, table is Sheet1)
Where segstart > '$(Last)';
Regards
Anand
Hi
Peek() refers to the output fields from the LOAD, Previous refers to the input fields.
Where @7 > Previous(@7) // no quotes
or
Where @7 > Peek(segstart) // no quotes
The 3 parameter version of Peek() is for use outside of a load statement only.
HTH
Jonathan
Load this in a temp table as
RAwData:
LOAD
@1 as callid,
@2 as acwtime,
@3 as ansholdtime,
@4 as consulttime,
@5 as disptime,
@6 as duration,
@7 as segstart
FROM
[$(vFilePath)]
Data:
load *
,peek(segstart,1,RAwData) as Last value
resident RawData;
drop table RawData;
Hi,
Try to load a table and find the last value and store it in variable with Peek function
tablename:
LOAD
@1 as callid,
@2 as acwtime,
@3 as ansholdtime,
@4 as consulttime,
@5 as disptime,
@6 as duration,
@7 as segstart
FROM
[$(vFilePath)]
(ooxml, embedded labels, table is Sheet1);
Let Last = peek('@7',-1,'table name');
TRACE $(Last);
DROP Table [table name];
NewLoad:
LOAD
callid,
acwtime,
ansholdtime,
consulttime,
disptime,
duration,
segstart
FROM
(ooxml, embedded labels, table is Sheet1)
Where segstart > '$(Last)';
Regards
Anand
Hi Anand,
Thanks for your reply its help full for me.
Thanks,