Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
lucasx15
Contributor III
Contributor III

Maketime in difference months?

Hello everyone, I'm applying the data difference in a table using maketime, where the interval time needs to be less than 1 hour. However, it is counting incorrectly.

LOAD NR_CLIENT,
IF(Interval((DT_CHANGE)-(DT_AVAL))<=MakeTime(1,0,0),'S')AS FL_INTERVAL
RESIDENT ATEND_CLIENT_ALL;

 

estranho.jpg

Labels (1)
1 Solution

Accepted Solutions
Or
MVP
MVP

Interval() is a formatting function. It doesn't modify the underlying value, which as per my previous post is negative 16.2.

 

View solution in original post

3 Replies
Or
MVP
MVP

DT_CHANGE - DT_AVAL is negative, ~ -16.2, so it is obviously smaller than MakeTime(1,0,0) which is ~0.42....

Perhaps you'll want to apply fabs() to the first part to avoid the issue of negatives?

lucasx15
Contributor III
Contributor III
Author

The issue is that line shouldn't mark the 'S' because the interval between these two dates is >=1 hour. And I was confused without understanding

Or
MVP
MVP

Interval() is a formatting function. It doesn't modify the underlying value, which as per my previous post is negative 16.2.