Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Luke_Killer_IT
Creator
Creator

Date filter on year

Hello,

Can you help me filter the date in the script? I want the filters to give me only the numbers of the week until 2021 and 2020 is to be listed

Script:

Where (Year(MMT_MRPAccount.MRPDate) <= Year(Today())) and ( Week(MMT_MRPAccount.MRPDate) and (year(MMT_MRPAccount.MRPDate)=2021)) <= (Week(Today()) + WeekName(3));

Luke_Killer_IT_1-1624343406776.png

Luke_Killer_IT_2-1624343424484.png

It is scheduled to end on week 28

2 Solutions

Accepted Solutions
MayilVahanan

Hi 
Try like below

Where MMT_MRPAccount.MRPDate <=MakeWeekDate(Year(Today()),Week(Weekend(Today()+21)));

-- you can change based on ur requirement instead of this (Weekend(Today()+21)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

Luke_Killer_IT
Creator
Creator
Author

Hi, 

I was able to do what the code seemed to interest someone

Code:

expression >= AddMonths(Today(),-3)

View solution in original post

4 Replies
MayilVahanan

Hi 
Try like below

Where MMT_MRPAccount.MRPDate <=MakeWeekDate(Year(Today()),Week(Weekend(Today()+21)));

-- you can change based on ur requirement instead of this (Weekend(Today()+21)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
ElsieSmith
Contributor
Contributor

  1. Select the Data tab, then click the Filter command. A drop-down arrow will appear in the header cell for each column.  official site
  2. Click the drop-down arrow for the column you want to filter. 
  3. The Filter menu will appear. 
  4. The worksheet will be filtered by the selected date filter.
Luke_Killer_IT
Creator
Creator
Author

Hi @MayilVahanan ,
I have a similar problem, but now the other way around I have to narrow my search down to 3 months back from the current month.

 my code:

MLL_Movements.Postingdate >= MakeWeekDate(Year(Today()),Month(Today()-105));

Luke_Killer_IT
Creator
Creator
Author

Hi, 

I was able to do what the code seemed to interest someone

Code:

expression >= AddMonths(Today(),-3)