Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

calculate how many weeks from today to a given date

Hello

I would to know how to calculate how many weeks from today to a given date.

For example as attached,

I used

floor(Interval(Today()-CalendarYMD,'D')/7)

to calculate how many weeks from today to a given date.

But, you can see here, there are different values for days in the same week.

week_cal.PNG

3 Replies
sunny_talwar

May be try this:

Floor(Interval(Today()-WeekStart(CalendarYMD),'D')/7)


Capture.PNG

Anonymous
Not applicable
Author

Sunny T,

It works!

Good to know there is a WeekStart function.

Thanks again

Josh

sunny_talwar

Hahaha yes, there is WeekStart and WeekEnd functions. Here you can find a list of all date and time related functions

https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/d...

Best,

Sunny