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: 
P_qlik
Partner - Contributor III
Partner - Contributor III

problem with a date filter in nprinting

Hi,

in'm new in qlik nprinting.

I have a date field in this format:  1/12/19, 1/13/19, 1/14/19..., I want to create a filter in  the report that gives me 2 years before current year, which formula should I put?

Thank you

 

Labels (2)
4 Replies
Frank_S
Support
Support

Here again is the link for dynamic filters. https://help.qlik.com/en-US/nprinting/February2021/Content/NPrinting/ReportsDevelopment/Static-dynam...

An example again of a dynamic filter for 2 years ago is:

=Year(now()-1)

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Here are things I have already written about it:

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

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

 

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.
jamesdon1234
Contributor
Contributor

Dual in dates is even less forgiving as it might not show time portion of it. For example, you see in Qlik Sense/QlikView field with date= 01/01/2008 which is stored as a timestamp and actually can be 01/01/2008 12:00 PM. This means that your numerical value would be 39448.5, so as you can see there is decimal point in your numerical representation of timestamp and makes the value different that 39448 which would be just date. My usual advice is to apply Floor() function during Qlik script load of datamodel. This removes decimals and ensures that they are stored in field. On the same note you might have another trap when working with “Evaluate value” in NPrinting filters. If you use functions like MonthEnd(), WeekEnd() they will return timestamp  as well representing end of period so for example if today is 15/02/2019, MonthEnd(Today()) will return 28/02/2019 11:59:59 PM. Therefore again you have to wrap your formula in Floor() function to return only integer/day.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

@jamesdon1234 

That looks exactly like copy/paste from my blog ....

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.