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: 
oanalung
Contributor III
Contributor III

NPrinting Filter

Hi,

I want to generate an NPrinting report with data from QlikView that will only  show data from a table based on a date column - I want to show data for previous month.

Date Column has the following format - Date_column = 2022 01

I have tried with Filters in NPrinting(Create Filter -Fields -Date_column - Value is - Advanced Search/Value is -> Date_column= Date(AddMonths(Today(),-1,'YYYY MM') but it's not working. 

Thank you

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

Hi @oanalung , 

Lets cover the basics:

  • NPrinting version:
    • NPrinting version you are using (17.3 indicated by tag you have chosen when creating post) does not support Advanced search filters
    • NPrinting version you are using (17.3) - is no longer supported and I urge you to upgrade to the supported version
  • Date_column

Now last thing to understand are the functions you are trying to use: Below functions creates (I broke it down for you, also note red bracket below which was missing in your syntax):

  • Date(AddMonths(Today(),-1),'YYYY MM')
    • Todays date "Today()" = which is 44614 (that is the value of date for 22-02-2022)
    • Todays date for last month "AddMonths(Today(),-1)" = which is 44583 (that is the value of date for 22-01-2022)
    • Date MASK on Todays date for last month "Date(AddMonths(Today(),-1),'YYYY MM')" = which again  is 44583 (that is the value of date for 22-01-2022 even if it only shows year and month when used with date() function. The actual value behind it is a dual with numerical being 44583)

What I tried to show you is that use of (Date()) function does not change anything as effectively the value returned is still the same and it is actual date - all what it does is just apply certain format. More about date function on Qlik help side: https://help.qlik.com/en-US/sense/February2022/Subsystems/Hub/Content/Sense_Hub/Scripting/Formatting... 

The very poor solution to your query would be probably syntax for Advanced Search like below - assuming that you upgrade your NPrinting version to supported version with Advanced Search:

  • TEXT(Date(AddMonths(Today(),-1),'YYYY MM'))
    • That would take the MASK of 'YYYY MM' from the DATE() function and use that as a TEXT search effectively searching for text '2022 01'

 

At the end I provide you with the links to documentation about the filters you are trying to use and links to topics on my blog where I describe issues with filters:

 

Summary:

knowing how your field is created, its data type/tag and its values we would likely be able to provide you with different solution than the poor one with text() function.

 

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.