Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
microwin88x
Creator III
Creator III

No. Days Difference

Hello,

I need to get the number of days between today and different dates.

I use the following expression:

=INTERVAL(DATE(TODAY())-DATE_TIME_TRANSACTION,'DD')

(The field DATE_TIME_TRANSACTION has this format: DD/MM/YYYY hh:mm:ss)

The problem is that when I have transactions from today, it returns me the value -1.

Do you know how could I solve this?

Thank you!

Labels (1)
5 Replies
jduenyas
Specialist
Specialist

INTERVAl takes only one parameter and compares against system's date.

Difference between dates:

Today() - [other date]

Example: Today()-Date('5/1/2018')

sunny_talwar
MVP
MVP

May be this

=Today() - Floor(DATE_TIME_TRANSACTION)

shiveshsingh
Master
Master

Try floor as suggested by Sunny , it will work. Floor will omit your time part

Today() - floor(DATE_TIME_TRANSACTION)

Anonymous
Not applicable

Hi

try  this

SET TimestampFormat='DD/MM/YYYY hh:mm:ss';

LOAD * ,

Interval(Today()-date,'dd' )as count

INLINE [

    date

    01/05/2018 08:40:45

    02/05/2018 08:40:45

];

time.PNG

vishalarote
Partner - Creator II
Partner - Creator II

FLOOR(NUM(now()-date)) as Count