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

Conditional Date Range Filter

Good Day,

If this topic has already been discussed I apologize.

 

I'm new to Nprinting and do want to create a dynamic filter for automisation purposes.

The following shall be expressed:

If the current day of the month is greater than 20, then show me/select all months from the start of the year until last month, else then show me/select all months from the start of the year until second to last month.

E.g., on the 22nd of April, the months January until March shall be shown. On the 1st of Mai, the the months January until March shall be shown as well until the 20th of Mai and so on.

Any ideas how and where (Advanced Search?) to approach this issue? Do you need more info?

Btw.: I cannot change the script, so I can't flag the months.

Thanks in advance and kind regards

Stefan

 

Labels (2)
1 Solution

Accepted Solutions
Ruggero_Piccoli
Support
Support

Hi,

There are some similar examples that uses Advanced Search at:

My suggestion is to first develop the advanced search directly in the source Qlik Sense app then copy the formula in a Qlik NPrinting filter. 

Refer to https://help.qlik.com/en-US/nprinting/February2021/Content/NPrinting/ReportsDevelopment/Static-dynam... I also suggest to read the whole page about filters.

I hope this helps.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.

View solution in original post

3 Replies
Ruggero_Piccoli
Support
Support

Hi,

There are some similar examples that uses Advanced Search at:

My suggestion is to first develop the advanced search directly in the source Qlik Sense app then copy the formula in a Qlik NPrinting filter. 

Refer to https://help.qlik.com/en-US/nprinting/February2021/Content/NPrinting/ReportsDevelopment/Static-dynam... I also suggest to read the whole page about filters.

I hope this helps.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
StefanE
Contributor III
Contributor III
Author

Hi Ruggero,

Your approach totally worked for me. I tweaked it a little bit with an if statement:

 

=if(day(today())>19, [YearMonth]<=(year(addmonths(today(), -1)))*100 + MONTH(addmonths(today(), -1)), [YearMonth]<=(year(addmonths(today(), -1)))*100 + MONTH(addmonths(today(), -2)))

 

Thanks so much for your support!

Kind regards

Stefan

Ruggero_Piccoli
Support
Support

Hi,

Happy to hear that you solved. Thanks for sharing the solution in the community: it will be a useful example for other readers. 

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.