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

Relative calendar field: WeeksAgo

Hi, i'm very new to Qliview and am trying to set up some relative calendar dates in my Master Calendar. I found these statements on one of the design blogs and they're very useful.


Today() - Date as DaysAgo,

12*(Year(Today())-Year(Date)) + Month(Today()) - Month(Date) as MonthsAgo,

However, I really need one for WeeksAgo as well

My best guess was

52*(Week(Today())-Week(TempDate)) + Week(Today()) - Week(TempDate) as WeeksAgo

but this doesn't seem to work. What am I doing wrong?

1 Solution

Accepted Solutions
Not applicable
Author

I found the answer somewhere

(WeekStart(Today()) - WeekStart(TempDate))/7 as WeeksAgo

View solution in original post

1 Reply
Not applicable
Author

I found the answer somewhere

(WeekStart(Today()) - WeekStart(TempDate))/7 as WeeksAgo