Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
has75042
Creator
Creator

How to calculate days since last transaction

Hey All,

I have a transaction date column, and I want to calculate how many days has it been since the last transaction date.

I am using (today()-date column). I am not getting any result. 

Any help would be really appreciative

Thanks 

3 Replies
Thomas94
Contributor II
Contributor II

=Today()-date column should work. 

If it isn't working, try using the Interval() function.

fabs(Interval(Today()-Datecolumn,'d'))

The Interval function will give you the difference in days between two dates. 

The Fabs function will make sure that your result is always a positive number

Also make sure your date column is formatted as a date. 

asinha1991
Creator III
Creator III

if the date column doesn't have one to one mapping with whatever group by you are doing.

Try aggregation.

ex: today()-max(datecolumn)

if I have not understood it wrong,

you can use interval on top to format

nicouek
Contributor III
Contributor III

The 

Today()-[Yourfield]

worked.

Thank you