10 Replies Latest reply: May 29, 2017 9:46 AM by Andre Costa RSS

    Dynamic Filter Nprinting 17

    Manuel Rühl

      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-filters.htm

      "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.

        • Re: Dynamic Filter Nprinting 17
          Lech Miszkiewicz

          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

          • Re: Dynamic Filter Nprinting 17
            Robin Hausdörfer

            you could alternatively try:

             

            = YOURYEARFIELD = Year(now())-1


            (--> deactivate evaluate)

            • Re: Dynamic Filter Nprinting 17
              Ruben Marin

              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.

              • Re: Dynamic Filter Nprinting 17
                Lech Miszkiewicz

                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.

                • Re: Dynamic Filter Nprinting 17
                  Manuel Rühl

                  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.