Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bug comparing time stamp in load script

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

8 Replies
Anonymous
Not applicable
Author

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.

aveeeeeee7en
Specialist III
Specialist III

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

ashfaq_haseeb
Champion III
Champion III

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

Not applicable
Author

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

Not applicable
Author

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

Not applicable
Author

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

ashfaq_haseeb
Champion III
Champion III

Hi
I have even changed variable defination

Earlier


LET vMostRecent = Peek('mostRecent');

Now

LET vMostRecent = Peek(mostRecent);


Regards

ASHFAQ

Anonymous
Not applicable
Author

The "exactly equal" is the explanation.  It's impossible to have timestamps exactly equal.  Use your workaround, or use > instead of >=