Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
Attached please find the qvw and qvd to illustrate my problem while attempting to load records with the most recent time stamp. I ended up applying a workaround. I appreciate it if you can provide a proper solution.
/LC
Lawrence, try
WHERE TimeStamp >= '$(vMostRecent)'
I suspect that without single quotes it considers the variable as expression and tries to calculate
The workaround works because this -.0.0000001 converts timestamp format to numeric, which is OK to compare with the timestamp.
Hi Lawrence
Use Group By() function to get Max Timestamps with every Id
Try this:
LOAD
Id
Max(TimeStamp) as mostRecent
FROM
TimeStampProblem.qvd
(qvd) Group By Id;
Hope that helps you.
Regards
Aviral Nag
Hi Lawrence,
Try below
temp:
LOAD Max(TimeStamp) as mostRecent
FROM
TimeStampProblem.qvd
(qvd);
LET vMostRecent = Peek(mostRecent);
DROP Table temp;
Items:
LOAD TimeStamp, Id
FROM
TimeStampProblem.qvd
(qvd)
WHERE TimeStamp >= '$(vMostRecent)' // this doesn't work
//WHERE TimeStamp >= $(vMostRecent) - 0.00000001 // my workaround
;
// ----- clean up -----
LET vMostRecent = Null();
Regards
ASHFAQ
Michael,
The ' ' doesn't appear to be the problem; I've tried.
The problem appears to be that the value TimeStamp is exactly equal to vMostRecent. Incidentally, both are numeric. That's why I think the workaround works.
/LC
Ashfaq,
The ' ' around the variable doesn't appear to be the bug. The problem I think is that incidentally TimeStamp and vMostRecent appear to have identical numeric value. That's why I think my workaround works.
/LC
Hi Aviral Nag,
Thanks for replying. Locating the correct max timestamp value isn't the source of the bug. The bug is in the WHERE clause.
/LC
Hi
I have even changed variable defination
Earlier
LET vMostRecent = Peek('mostRecent');
Now
LET vMostRecent = Peek(mostRecent);
Regards
ASHFAQ
The "exactly equal" is the explanation. It's impossible to have timestamps exactly equal. Use your workaround, or use > instead of >=