Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm struggling to properly load some data. I need to pull some data from a QVD file, sort it by a timestamp, pull the most recent record and take one field from that 'row'. However, I cannot get any data to load into the table structure, despite the same code working elsewhere.
Here is the pseudo-code:
Get existing data:
TABLE1:
LOAD
timestamp,
checkpoint
FROM [lib://QVD.QVD]
(qvd);
TABLE2:
FIRST 1 LOAD *
RESIDENT TABLE1
ORDER BY timestamp DESC;
LET CHECKPOINT_TOKEN = [checkpoint];
Make API call with the above variable. However, using trace for this variable, it is always blank.
Can anybody help?
Thanks
Hey there,
This is likely what you're looking for:
// Build table
[t1]:
LOAD * INLINE [
timestamp,checkpoint
2021-03-11 12:46:00,A
2021-03-11 12:47:00,B
];
// Load second table with reverse ordering by timestamp
[t2]:
NoConcatenate
FIRST 1 LOAD
*
Resident [t1] ORDER by [timestamp] DESC;
DROP TABLE [t1];
// Inspect the first (and only) record in t2
LET CHECKPOINT_TOKEN = Peek('checkpoint',0);
TRACE $(CHECKPOINT_TOKEN);
Hey there,
This is likely what you're looking for:
// Build table
[t1]:
LOAD * INLINE [
timestamp,checkpoint
2021-03-11 12:46:00,A
2021-03-11 12:47:00,B
];
// Load second table with reverse ordering by timestamp
[t2]:
NoConcatenate
FIRST 1 LOAD
*
Resident [t1] ORDER by [timestamp] DESC;
DROP TABLE [t1];
// Inspect the first (and only) record in t2
LET CHECKPOINT_TOKEN = Peek('checkpoint',0);
TRACE $(CHECKPOINT_TOKEN);