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

Calculating weeks from number of days between two dates

Hi, 

 

Can some please clarify how to convert the number of days between two dates into weeks?

 

We have date A and Date B. (01/01/2021 & 22/01/2021) that are 21 days apart. how do I convert the days into '3 weeks' in order to display the time taken into a Barchart as weeks?

Thanks

Labels (1)
1 Reply
Anil_Babu_Samineni

Try like this?

Floor(Fabs(Interval(Date#([date A], 'DD/MM/YYYY')-Date#([Date B],'DD/MM/YYYY'), 'DD'))/7) & ' Weeks' as WeekField

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful