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

The date filter is not giving output in NPrinting

Hi,

I created a filter in NPrinting as mentioned below

Field Name  : SLA_DataMonth 

Evaluate Value is =Text(date(AddMonths((date(now())),-3),'MMM-YYYY'))

 

The Field name SLA_DataMonth is having the values are like Aug-2019, Sep-2019, Jul-2019,etc...

 

I need to generate specific month data based on system date / Machine date dynamically (mainly previous month data from system date) in NPrintng.

Note : The type of format is Excel and Output format is PDF

 

Please find attached screenshot for your reference and help me out.

 

Regards,

Vara

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

1. you are not using NPrinitng 17.0 - so please choose your labels accordingly to the version you are using as this is misleading other users and makes no sense for community to have labels if they are not used properly.

2. your date in Qlik Sense is not text in format MMM-YYYY, It is integer/numeric value with format mask on top of it. it will be likely first day of the month with no day shown in a mask. This is simple "dual" data type with numerical value and text representation. To learn about it you can put your date field in Qlik Sense table and you will learn that when you put =num(SLA_DataMonth ) is not a date, but number, and to properly apply NPrinitng filter you need to return in "Evaluate function" a number. This is documented in official documentation which I encourage you to study before posting questions which have answer there:

https://help.qlik.com/en-US/nprinting/September2019/Content/NPrinting/ReportsDevelopment/Static-dyna...

a wrote a topic about it here:

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

 

Now to be sure how exactly your filter needs to be evaluated I would first check Qlik Sense script and I would look there for a function which was used to create this field. Is it something like the code below?

Date(MonthStart(SLA_Data),'MMM-YYYY') ?

If it is, then your filter in NOrinitng should be:

Evaluate Value is =num(MonthStart(AddMonths(Today(),-3)))

 

 

 

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

2 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

1. you are not using NPrinitng 17.0 - so please choose your labels accordingly to the version you are using as this is misleading other users and makes no sense for community to have labels if they are not used properly.

2. your date in Qlik Sense is not text in format MMM-YYYY, It is integer/numeric value with format mask on top of it. it will be likely first day of the month with no day shown in a mask. This is simple "dual" data type with numerical value and text representation. To learn about it you can put your date field in Qlik Sense table and you will learn that when you put =num(SLA_DataMonth ) is not a date, but number, and to properly apply NPrinitng filter you need to return in "Evaluate function" a number. This is documented in official documentation which I encourage you to study before posting questions which have answer there:

https://help.qlik.com/en-US/nprinting/September2019/Content/NPrinting/ReportsDevelopment/Static-dyna...

a wrote a topic about it here:

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

 

Now to be sure how exactly your filter needs to be evaluated I would first check Qlik Sense script and I would look there for a function which was used to create this field. Is it something like the code below?

Date(MonthStart(SLA_Data),'MMM-YYYY') ?

If it is, then your filter in NOrinitng should be:

Evaluate Value is =num(MonthStart(AddMonths(Today(),-3)))

 

 

 

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

Hi Lech,

 

Thank you, its working in Nprinting now. Getting data as we expected with below mentioned expression.

Evaluate Value is =num(MonthStart(AddMonths(Today(),-3)))

 

Regards,

Vara