Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
dominik_m_
Creator
Creator

Report next 7 days

Hi,

I have some tables in a report which shall only show the data for the next 7 days.

=week(now())+1

isn't working. I've tried different writings. Put the +1 on different locations. Tried something with days +7... The report always says "Invalid selections"

Any Ideas?
Thanks in advance!

Labels (2)
1 Reply
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

It is hard to give you an answer without knowing how the field you are trying to filter on is created in Qlik Sense script. Do you use some sort Floor() and Date() functions to make sure there no timestamps on date field?

Also week(now())+1 is not really good approach as it will not give you right result. Using now() finction is also not right as it returns timestamp (date and time) which also is not what you need.

Lets just assume that you need to filter based on "MyDate" field which is create in script using 

...
 Date(Floor(SomeDate)) as MyDate
...

now... The fact that we applied Date() mask on numerical value of the date does not mean anything... we still need to apply numerical filter...

to achieve this you would use:

Option 1: https://nprintingadventures.com/2019/02/15/the-pitfalls-of-nprinting-filters-part-1-dates-and-duals/

  • numerical value is: Floor(Today()+1)
  • numerical value is: Floor(Today()+2)
  • numerical value is: Floor(Today()+3)
  • numerical value is: Floor(Today()+4)
  • numerical value is: Floor(Today()+5)
  • numerical value is: Floor(Today()+6)
  • numerical value is: Floor(Today()+7)

Option 2: https://nprintingadventures.com/2019/06/26/nprinting-filters-part-3-advanced-search/

  • Advanced Search  =([MyDate]>Today())*([Date]<=Today()+7)

Thats it

 

hope this helps

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.