Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
profilejamesbond

Dates and Calender Week

Hi,

Scenario: I have date range from 01.01.2023 to 07.02.2023.

On 07.02.2023 the previous Calendar week start from 30.01.2023 to 05.02.2023.

So, 30.01.2023 and 31.01.2023 belongs to previous month Jan. while 01.02.2023 to 05.02.2023 belongs to this month Feb. But the complete week is Calender Week 5.

Question: how to mark these two dates 30.01.2023 and 31.01.2023 -> Flag_PreviousMonthDays

and 01.02.2023 to 05.02.2023 Flag_ThisMonthDays?

 

profilejamesbond_0-1679387826118.png

 

Labels (6)
3 Replies
Or
MVP
MVP

Why would the week number impact which month the day belongs to? You can still test on Month(Today()) = Month(YourDate) regardless of weeks.

profilejamesbond
Author

because I have to make filter for these days and then I have to analyze the data in tables according to the filter and send NPrinting Reports.

Or
MVP
MVP

I understand the need to flag which month a day belongs to, I just don't understand why that would be impacted by the week number that day belongs to. If you compare the MonthName(Date) to MonthName(Today()) you would get the flag for this month, and AddMonths(Today(),-1) would get you the previous month.