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: 
fernfrancis
Contributor
Contributor

Filter based on date

Hi Team

I am building a custom report in Nprinting , in doing so I need the date of the previous day not the last 24 hours how can I achieve this?

Just to provide more information , I have 3 different field in the report for the date i.e Day takes value from 1-31 depending on the month. second field is Month which take values from 01-12 and Year which is in the format 2019.

In the filter I  need to put a expression in such a way that it would yield me one day before data not last 24 hour data. 

I came across this but dont know what it means . if someone can help me out.

Num(Day(Today(1)-1),'00')

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, 

first of all Qlik Sense does not work with NPrinitng 16.5 as that version only works with QlikView. Make sure you provide us correct versions of NPrinting and Qlik Sense so we can provide you with correct suggestion.

Regarding date filter. 

Having 3 separate fields is not really a good practice as you will need to build 3 field filter for it. Obviously most important thing is to understand datatype of those fields as depending on that filter setup will be different (read about datatypes in links below).

I am guessing your fields are of a dual type so therefore I would set them up like this:

  • Year: evaluate value: =Year(Today()-1)
  • Month: evaluate value: =num(Month(Today()-1))
  • Day: evaluate value: =num(Day(Today()-1))

Lech_Miszkiewicz_0-1636929670109.png

 

Obviously you need to create a filter which filters all 3 fields separately if you dont have one "Date" field. 

 

The way I would set it up would be by:

  • having a "Date" field created in Qlik Sense load script which would use script like below to remove timestamp from it:
    • Date(Floor("your_date")) as Date
  • Then in NPrinting I would have a filter like below:
    • Date: evaluate value: =Floor(Today()-1)

More about data types and filters I explain here: 

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.

View solution in original post

1 Reply
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, 

first of all Qlik Sense does not work with NPrinitng 16.5 as that version only works with QlikView. Make sure you provide us correct versions of NPrinting and Qlik Sense so we can provide you with correct suggestion.

Regarding date filter. 

Having 3 separate fields is not really a good practice as you will need to build 3 field filter for it. Obviously most important thing is to understand datatype of those fields as depending on that filter setup will be different (read about datatypes in links below).

I am guessing your fields are of a dual type so therefore I would set them up like this:

  • Year: evaluate value: =Year(Today()-1)
  • Month: evaluate value: =num(Month(Today()-1))
  • Day: evaluate value: =num(Day(Today()-1))

Lech_Miszkiewicz_0-1636929670109.png

 

Obviously you need to create a filter which filters all 3 fields separately if you dont have one "Date" field. 

 

The way I would set it up would be by:

  • having a "Date" field created in Qlik Sense load script which would use script like below to remove timestamp from it:
    • Date(Floor("your_date")) as Date
  • Then in NPrinting I would have a filter like below:
    • Date: evaluate value: =Floor(Today()-1)

More about data types and filters I explain here: 

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.