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

NPrinting not appling YYYY-MM Filter

Hello,

I am having an issue with NPrinting appling filter.

Once a week an excel report sent by nprinting. New request is to send the last month report on the new month until the 7 of the current month

for example, on May 5th I still need to send the last month report.

So I added the new filter with the correct name field (shown on the screenshot) and try to apply the filter:

=if(day(today())<7,date(ADDMONTHS(today(),-1),'YYYY-MM'),date(today(),'YYYY-MM'))

Last Month filter not appling.PNG

from some reason its not working.

 

 

But if I change it to the next screenshot it will work.

Last Month filter appling.PNG

 

why is this happening?

I read in here:

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

but still with no success.

 

Hope someone can help me with it.

Thanks

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

also - judging by the fact that filter is working when you put it as a "Value is:" I am assuming your field type is Text (ASCII). 

That would require your formula to look like:

=text(date(if(day(today())<7,ADDMONTHS(today(),-1),today()),'YYYY-MM'))

 

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

5 Replies
settu_periasamy
Master III
Master III

Hi,

Have you tried without equal sign ?

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Please make sure that you understand what each of the functions you are using in your formula is doing and how field used in filter was created in load script .

Start with understanding how your YYYY-MM field is created in Qlik and to give you correct answer and be 100% sure that it will work we need to see Qlik script creating this field.

it can be something like:

 

Date(MonthStart(SomeDate),'YYYY-MM') as someYYYYMMfield

 

 

If it is a date (just like shown above) it holds under this mask actual value of the monthstart which is a timestamp.

Read those articles about pitfalls of NPrinting filters again. I explained them with examples:

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

Note, that the most important thing is to:

  • configure your source field properly
  • understand its data type and consequences of using MonthStart, MonthEnd,WeekEnd,WeekStarte etc... functions
  • Understand each of the filters options Value is, Numerical Value is, Evaluate, Advanced Search etc...

 

If you come back to us with answer how your field is created we may be able to help you more...

cheers

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

also - judging by the fact that filter is working when you put it as a "Value is:" I am assuming your field type is Text (ASCII). 

That would require your formula to look like:

=text(date(if(day(today())<7,ADDMONTHS(today(),-1),today()),'YYYY-MM'))

 

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.
idodel
Contributor III
Contributor III
Author

Thank you, it applied good when wrapping it in a text() function.

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

It means that your field you tried to filter is not a proper date field but text field

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.