Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

mruehl
Contributor III

Dynamic Filter Nprinting 17

Hello,

I want to filter on yesterday by date(today()-1) but the filter doesn't work.

The report is not generated at all.

I tried this:

http://help.qlik.com/en-US/nprinting/17.3/Content/FiltersCycles/StaticDynamicFilters/Static-dynamic-...

"For example, to retrieve the value of the last year, enter =Year(now())-1. "

but neither =Year(now())-1 nor =date(today()-1) works.


Filter option is "evaluate".


In Nprinting 16 it works perfectly.

1 Solution

Accepted Solutions
Lech_Miszkiewicz
Honored Contributor III

Re: Dynamic Filter Nprinting 17

Hi

For testing i am attaching an application Total.qvw

I am using this app and i am creating a filter to calculate a yesterdays date in it. I am not having any other filters applied on top of my "Yesterday" filter. If you are using recipient list to distribute reports, make sure that there aint no filters interfering or even excluding each other.

Here are the steps:

1. Create a connection to your QlikView or QlikSense application

2. Recognise what type of data you want to filter. This is important as dates are usualy DUAL values (text and number)

  • If field value is numeric you need to create numeric filter
  • If field value is DUAL - you need to create numeric filter with numeric value associated to text(dual) value. this may be your issue as dates are usually duals - so you need to create numeric filter for it
  • If field value is text - you need to create strng filter

np2.png

3. in my example my date is actualy numeric value - so i will need to create numeric filter in nprinting 17

4. create a filter in NPrinting - i called my "Yesterday":

np1.png

...

5. Add fields to your filter:

I have added my Date field and I have chosen to evaluate value to be Yesterday numeric value due to data type recognised in my pt.2. Therefore I am using num(Today()-1)


np0.png

6. Then simply create a report and add this filter to report or task

(this is my source document and i want it to be filtered by yesterdays date (i am looking at Date Chart table))

np3.png

(creating nprinting excel template)

np7.png

(adding filter to report or task - wherever you like)

np6.png

Create a publish task and see results:

(worked for me )

np8.png

hope this helps you

cheers

Lech

cheers Lech
When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution.
Please LIKE threads if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem.
10 Replies
Lech_Miszkiewicz
Honored Contributor III

Re: Dynamic Filter Nprinting 17

Hi

For testing i am attaching an application Total.qvw

I am using this app and i am creating a filter to calculate a yesterdays date in it. I am not having any other filters applied on top of my "Yesterday" filter. If you are using recipient list to distribute reports, make sure that there aint no filters interfering or even excluding each other.

Here are the steps:

1. Create a connection to your QlikView or QlikSense application

2. Recognise what type of data you want to filter. This is important as dates are usualy DUAL values (text and number)

  • If field value is numeric you need to create numeric filter
  • If field value is DUAL - you need to create numeric filter with numeric value associated to text(dual) value. this may be your issue as dates are usually duals - so you need to create numeric filter for it
  • If field value is text - you need to create strng filter

np2.png

3. in my example my date is actualy numeric value - so i will need to create numeric filter in nprinting 17

4. create a filter in NPrinting - i called my "Yesterday":

np1.png

...

5. Add fields to your filter:

I have added my Date field and I have chosen to evaluate value to be Yesterday numeric value due to data type recognised in my pt.2. Therefore I am using num(Today()-1)


np0.png

6. Then simply create a report and add this filter to report or task

(this is my source document and i want it to be filtered by yesterdays date (i am looking at Date Chart table))

np3.png

(creating nprinting excel template)

np7.png

(adding filter to report or task - wherever you like)

np6.png

Create a publish task and see results:

(worked for me )

np8.png

hope this helps you

cheers

Lech

cheers Lech
When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution.
Please LIKE threads if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem.
roharoha
Valued Contributor III

Re: Dynamic Filter Nprinting 17

you could alternatively try:

= YOURYEARFIELD = Year(now())-1


(--> deactivate evaluate)

Re: Dynamic Filter Nprinting 17

Hi Manuel, I didn't tested but seems that Lech already posted a good answer.

If still doesn't works maybe the problem comes from another way... is the app updated? maybe you are doing tests in an app not scheduled to reload and doesn't have data loaded for yesterday.

Just to give another option, in some cases I found useful use auxiliar field in apps to apply filters:

Calendar?: //Table where date field is loaded

     LOAD ...

     If(DateField=Today()-1, 1, 0) as isYesterday

First you can check in the app if the values are applied correctly, and second you can use this field as the filter by value, without the need of doing evaluations.

Lech_Miszkiewicz
Honored Contributor III

Re: Dynamic Filter Nprinting 17

I like an idea of flaging records during script reload an refer to flag in Nprinting filters

cheers Lech
When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution.
Please LIKE threads if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem.
roharoha
Valued Contributor III

Re: Dynamic Filter Nprinting 17

yes, it's a good idea, but the dynamic filters should also work...

Lech_Miszkiewicz
Honored Contributor III

Re: Dynamic Filter Nprinting 17

Hi Manuel,

did it work for you?

regards

Lech

---------------------------------------------

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 as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

cheers Lech
When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution.
Please LIKE threads if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem.
mruehl
Contributor III

Re: Dynamic Filter Nprinting 17

Thanks a lot for your answers!

I think my mistake is around dual and num .....

I didnt have the chance yet to check it, but ill let you know.

andrefpc
Contributor

Re: Dynamic Filter Nprinting 17

I Lech, like Manuel I'm struggling with dynamic filters using NPrinting 17.3.

I've tried to follow the steps you described but I get the "Wrong content node response type"

My date is numeric, timestamp. I've tried the filter with num() and timestamp() with no results.

Any ideas?

Maybe it's easier to flag the records that fall in the desired date range?

Thanks in advance,

Andre Costa

Lech_Miszkiewicz
Honored Contributor III

Re: Dynamic Filter Nprinting 17

Hi Andre,

What formula are you trying to apply in your filter? Is your formula rteturning 1 value or multiple values?

If you can flag records- then i would sugest to do that to keep your filters simpler and keep logic on Qlik side.

regards

Lech

cheers Lech
When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution.
Please LIKE threads if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem.
Community Browser