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: 
mattphillip
Creator II
Creator II

NPrinting 17: Filter to select most recent date available

Hoping someone can help,

I'm constructing an applications report in NPrinting 17 feeding in data from an existing dashboard. The data includes a date field to identify particular exports (exports are bi-weekly). Does anyone know how to set the report filter to tell NPrinting to filter by the most recent date available? I tried =max(Date) and =maxstring(Date) to no luck.

Any help would be most appreciated.

Matt

7 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Matt,

this is quite simple task but can be tricky if you are not fully aware of what data types are used in Qlik application.

In cases like this you would like to create a flag in you Qlik datamodel which would flag the max date with a binary flag 1,0 and use this in your nprinting filter.

regards

Lech

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.
mattphillip
Creator II
Creator II
Author

What I'm ideally looking for is a way to script to pick up the most recent date available automatically? The date changes daily.

Any help would be most appreciated.

M

Ruggero_Piccoli
Support
Support

Hi,

When you create a filter with a formula you must select Evaluate value from the drop-down menu. The formula =max(OrderDate) is correct because it returns a single value and you must compare it with the field OrderDate. I just did a test with Qlik NPrinting February 2018 and it works fine.

Best Regards,

Ruggero

---------------------------------------------

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
andrewmo
Creator
Creator

I have a Month - Year field (May-2018) in my source connection. I want to be able to filter the report for data from last month only.  I tried using Evaluate value of =Month(AddMonths(Date(Today()),-1))&'-'&Year(AddMonths(Date(Today()),-1)).  This expression works in the source document but when I apply it to the report in nPrinting it ignores the expression and pulls all data.  What am I doing wrong?

Frank_S
Support
Support

Tested on NP 18.9.5 April release and it is working as designed.

See formula in the NP 18.9.5 designer (NP 18.9.5 Server) on the left

See output on the right where May-2018 is the concatenation

concat works.PNG

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Frank_S
Support
Support

The above method only provides the corect concatenation data for the report template but to filter the actual datayou need split up your filter with two fields values as follows:

Filter name Concat"

Two filter values as follows:

filter type Evaluate

filter dimension: Month

=Month(AddMonths(Date(Today()),-1))

filter type Evaluate

filter dimension: Year

=Year(AddMonths(Date(Today()),-1))

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Ruggero_Piccoli
Support
Support

Hi,

In the filter it could be a problem of data type so try to add a text() to be sure that both (the forumla result and the original field) are strings. Something like =text(Month(AddMonths(Date(Today()),-1))&'-'&Year(AddMonths(Date(Today()),-1))).

Check also that the original field has not spaces at the beginning or the end. For example add a trim() in the load script.

Best Regards,

Ruggero

---------------------------------------------

When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.