Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
jchang_snwl
Contributor III
Contributor III

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

jchang_snwl
Contributor III
Contributor III
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