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: 
jblomqvist
Specialist
Specialist

How to make a dynamic Filter for a field in NPrinting 16? E.g. Select Year and Month based on an expression

Hello all,

I would like to make a dynamic selection in a filter that applies to the whole report.

The dynamic filter will be on my Year and Month field where an expression will calculate to select the current Year and last month from the current month.

I already have the expression for the two.

How do I enter this for a dynamic filter for the two fields?

3 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Looks like 1st result in google query will give you an answer

How to Create Static and Dynamic Filters Based on Fields

NP.png

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.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Just to add to it

Having 2 fields and applying selections on both does not make sense as:

  • current year = say 2017
  • current month = say Jan
    • so last month will be Dec
    • so your filter would be Dec-2017 which is wrong i guess??

I would simplify this task by creating one date field for each month:

  • MonthStart("YourDate") as A_field

Then your filter on A_field would require only one expression and it would be:

  • =MonthStart(AddMonths(Today(),-1))

hope this helps

cheers

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.