6 Replies Latest reply: Jan 7, 2016 11:13 AM by Adam Krepistman RSS

    Nprinting : Filtering issue..

    Anders Florentin Hansen

      Hi,

       

      I am pretty new to Nprinting... I have been trying to create a report where several filters needs to be applied...

       

      I am using the On-Demand extension in my QlikView document, and I want to use the current selections...

       

      My problem is:

       

      The current selection is for example a calendar year and month... But at a point in my report I need to clear the calendar year and month, to use a second calendar's year and month fields as filter.. Then later in the report reapply the currently selected year and month... How can I manage this??

       

      another question:

       

      - Is it possible to only apply a filter on an object so that it is never applied globally... It seems that when I create a filter, it is applied during start, and then again on the object?

       

      And two final questions:

       

      How are filters applied in general when running a cycle over a field...

       

      1. Are all filters created applied during initiation of the report?

      2. Filters applied to objects during report, are they "reset" when running next cycle?? making for example the current selections that initially was selected reselected?

       

       

      Regards,

      Anders

        • Re: Nprinting : Filtering issue..
          Adam Krepistman

          there is an option in your connection that is used to determine if current selections are applied to your report or if the report should clear all selection and apply filters

           

          regarding question 1, yes you can apply a filter to an object - this is located on the property of the object (but the filter must be defined first)

          filters are applied to selections made if clear all selections as shown above is not cleared - see attachement on how filters are applied

          How to: Creating NPrinting Filters Based on Existing QlikView Bookmarks

          How to Use Specific Filters with NPrinting On-Demand Reporting

            • Re: Nprinting : Filtering issue..
              Anders Florentin Hansen

              Hi,

               

              Thanks for the input, but "Clear all selections" is already unchecked.. And I have read the two how-to's earlier :-)

               

              I don't think that any of them are able to answer my questions...

               

              I have a bunch of "field" filters in my report, not bookmarks... Are field filters always applied globally in the report?? (when no Object filter is selected).  During report cycle over a field, are the filters reset after every run-though?

               

              Perhaps it is easier to understand my problem, if I tell you what I want to achieve  :-)

               

              Report:

               

              Cycle over company names ...

               

              report should contain:

               

              1. Income state statement pivot object (year and month selected in on-demand qvw must be used and applied to fields : Year and Month)

              2. Balance Sheet pivot object (year and month selected in on-demand qvw must be used and applied to fields : Year and Month)

              3. Assets and Investments pivot object (year and month selected in on-demand qvw must be used and applied to fields : Assets_Year and Assets_Month... The selections made in Year and Month must NOT be applied here, since these fields does not apply to the Assets and Investment pivot object)

              4. HR line chart (year and month selected in on-demand qvw must be used and applied to fields : Year and Month ... The selections made in Assets_Year and Assets_Month must NOT be applied here, since these fields does not apply to the HR line chart object...

              5. HR bar chart (Only the Year selected in on-demand qvw must be used and applied to field Year).

               

              Step 1-5 is cycled over...  ergo all of the above per company.. :-)

               

              To make this work... My first thought would be to create following filters...

               

              Step 1.(No filters needed)  (since it is already chosen from the current selections).

              Step 2 (no filer needed): Same as 1.

              step 3 (filter): Clear fields Year and Month.. Apply =getfieldselections(Year) to the field Assets_Year, and =getfieldselections(Month) to the field Assets_Month.

              step 4: ??? Are the filters created in step 3 applied globally (and not only on the object I have associated it with)?? If so, I no longer have any current selections... If the filter is only applied object wise... Are the "current selections still active after having run step 3?

              step 5: ?? Are year month still chosen? Okay.. If so... I clear the field Month...

               

              What then during next cycle... Are both Year and Month selected again (as current selection)? Or are the last filter applied to the last object in the report applied ? :-) Meaning... Only "Month" is now selected?? Then the next cycle will not work, since the Year is not selected... :-)

               

              Hope I made sense ....

               

              Regards,

              Anders

                • Re: Nprinting : Filtering issue..
                  Mike Czerwonky

                  Your current selections are a filter.   You have a problem that is complicated enough that I don't have time to do all of the research.  Let me give you an idea and see if you can run with it.

                   

                  Don't use current selections to filter your report.  I build a "home" sheet on all of my Nprinting projects where the user can go in and select parameters ( these are variables ) that do not trigger anything in the current selection box that will alter your data.  So, you might have a variable called current year, prior year, current month, etc. 

                   

                  ex.   vCurrentYear = 2015, when selected in your list box.

                   

                  Then create a Nprinting variable filter in the Nprinting Client to equal those variables.  Now you are telling your objects to report on the date, month or range you want.

                   

                  The on-demand part is setting the variables rather than the current selections.

                   

                  Hope that helps

                   

                  Mike

                    • Re: Nprinting : Filtering issue..
                      Anders Florentin Hansen

                      Hi Mike,

                       

                      I went with your suggestion... Got it working... I am still unsure if filters are applied when initiating the report, if they are applied when adding them to objects or both... If both, can I avoid the filters being applied when initiating the report?

                       

                      And, are the filters from each object still set, when coming to the next object in the report?

                      And, are the filters from last object in the report still set, when running next cycle in the report (over company name)?

                       

                      Anyway... Your suggestions work... So everything is good.. thanks a lot :-).. I am just trying to figure out the filtering process. :-)

                       

                      Regards,

                      Anders

                        • Re: Nprinting : Filtering issue..
                          Mike Czerwonky

                          Here is my understanding.

                           

                          There is a filter hierarchy that goes like this

                           

                          The order of application is Task -> Recipient -> Report. Since the Report Filters are applied last they therefore override all others (if they are on the same Field). The Recipient similarly overrides the Task Filter.

                           

                          So, the goal is not to have conflicting filters.

                           

                          If I am using On-Demand, I usually let my end user create the filters by making selections.  I don't have any of the other filters selected on the Nprinting side.

                           

                          If I am running a task or a scheduled report, I typically only use Task filters.

                           

                          I am pretty sure the filters are universal to all objects.  When I am designing objects, I often use variables to select data ranges and ignore the current selection in the app.

                           

                          So, when you run a task in the NPrinting Designer, Nprinting goes out and grabs all of the data that is needed from Qlikview and then applies the filter at the report creation.  When using On-Demand, the data is filtered at the Qlikview side before it is sent to Nprinting and then filtered further by the Nprinting Filters unless you tell it to ignore the current selection in your source setting.

                           

                          Here is another thread you can review that may help you understand

                           

                          Re: Nprinting - Filters vs Current Selections

                          • Re: Nprinting : Filtering issue..
                            Adam Krepistman

                            The only inforamtion I can add to Mikes excellent response is that there are now object level filters that can be applied, if yiou wanted just the object filtered differently.  Like Mike, I most commonly use task and recipient filters on scheduled reports and no filters for on demand since the users will be making selections within the application (which they do not do on scheduled reports).

                             

                            Make sure you do no check the clear selection on your connection for the on demand report

                             

                            there are some good examples of this in the nprinting tutorial enviornment