Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
louise119
Creator III

How to calculate days

How to calculate "2023/04/01"-"2023/03/02"?

 

2 Replies
Mike_Dickson
Support

Hello @louise119 

To calculate the number of days between two dates in Qlik Sense, you can use the following formula:

=Date#('2023/04/01', 'YYYY/MM/DD') - Date#('2023/03/02', 'YYYY/MM/DD')

This formula uses the Date# function to convert the dates from text format to date format, and then subtracts the earlier date from the later date to get the number of days in between.

Alternatively, you can use the Interval function to calculate the interval between two dates in a specific unit, such as days:

=Interval('2023/04/01' - '2023/03/02', 'DD')

This formula subtracts the earlier date from the later date and returns the interval in days.

Both of these formulas should give you the same result, which is 30.

 

Sr. Technical Support Engineer with Qlik Support
Don't forget to mark a solution that worked for you!
BrunPierre
Partner - Master

=Interval(Date(2023/04/01,'MM/DD/YYYY')- Date(2023/03/02,'MM/DD/YYYY'),'DD')

=Floor(Date(2023/04/01,'YYYY/MM/DD')- Date(2023/03/02,'YYYY/MM/DD'))