20 Replies Latest reply: Jun 5, 2018 3:48 AM by Ruggero Piccoli RSS

    NP17 Conditional Task: Don’t send email if no data?

    Chris Wellington

      Hi,

       

      So, I’m new to posting since this forum already has so much useful content! This time I'm comping up empty, though...

       

      I'm using NPrinting to send simple email with Excel report to about 30 people when they have outstanding assignments (based on data in QlikView). I’m using a single task to distribute the emails with filters at the user level so each individual only sees their own assignments. So far so good.

       

      The issue arises when a user has no outstanding assignments. In this case, the chart of assignments is, naturally, blank. I’ve created a condition with the rule “Chart CH01 has values” so these users won't get the reminder email.

       

      Within the given Publish Task in NPrinting, I see two ways to apply conditions:

      1. Apply condition to the report, and
      2. Apply condition to the task.

       

      If I apply the condition to the report, then the Excel report is only generated when the user has assignments to complete, but the email is still sent whether or not there is an associated report.

       

      If I apply the condition to the task, then the condition appears to only be checked once without considering the user-level filters.

       

      Below are some of the combinations I've tried and the results:

      Condition: CH01 Has Data. This should be True if anyone has assignments (for column "Any?") or if the given user has assignments (column "User filter?").

      Assignment statusConditionsResults
      Any?User filter?Report ConditionTask ConditionEmail sent?Report attached?Notes
      TrueTrueTrue TrueYesYesHas assignments, gets email; good
      TrueFalseTrueTrueYesNoNo assignments but gets email without report; bad
      TrueTrueTrueFalseNoN/ATask level condition works - no email sent
      TrueTrue FalseTrueYesNoReport level condition works - no report attached
      TrueFalseTrueFalseNoN/ATask level condition does not respect user filter

       

       

      Is there a way to apply conditions after user-level filters so that emails are only sent if the conditions are met? I don't want to generate separate tasks for each user!

       

      NPrinting Version: 17.1.2.0

       

      Thanks!

      Chris

        • Re: NP17 Conditional Task: Don’t send email if no data?
          Jonathan Zaid

          I have the same problem. I'm not sure if I understand your chart above but I think the simplification of the problem is that it seems as task level conditions are evaluated BEFORE filters are applied. Which means that the email is going out independent of the filter. 

          I submitted a ticket on this hoping for a better explanation or work-around and I'll be glad to post the response.

          Have you found any work-around?

          • Re: NP17 Conditional Task: Don’t send email if no data?
            Ruggero Piccoli

            Hi,

             

            Upgrade to latest version September 2017 (17.5) by following the instructions in Qlik NPrinting upgrade ‒ Qlik NPrinting

            Qlik NPrinting September 2017 will send emails only to users who have data.

             

             

            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 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: NP17 Conditional Task: Don’t send email if no data?
                Martina Jakovcic

                This is not true. I have the Version 17.5.

                But the user without data, became also a email. The message in the email is:


                Some errors occurred during report generation
                Number of reports not generated: 1
                Please contact your administrator for further details

                • Re: NP17 Conditional Task: Don’t send email if no data?
                  Giuseppe Uleri

                  Hi Ruggero,

                  I'm in the same situation as Chris but running September 2017 version.

                   

                  Still gettting mail sent without report in case of user filter produces and empty report because report conditions seems to be evaluated before user filters.

                   

                  Can you advise?

                   

                  Regards,

                  Giuseppe

                    • Re: NP17 Conditional Task: Don’t send email if no data?
                      Ruggero Piccoli

                      Hi Giuseppe,

                       

                      Here there are the rules about condition evaluation Conditions ‒ Qlik NPrinting

                       

                       

                      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 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: NP17 Conditional Task: Don’t send email if no data?
                          Giuseppe Uleri

                          Thank you Ruggero,

                          at this point can you confirm that there is no way to apply conditions after user filters evaluation and hence there is no other way to achieve rather than creating as many tasks as the number of recipients?

                           

                          Best regards,

                          Giuseppe

                            • Re: NP17 Conditional Task: Don’t send email if no data?
                              Ruggero Piccoli

                              Hi Giuseppe,

                               

                              Conditions affect when filters are applied. If you apply a condition to a task:

                              • If there is a task filter, the filter will be applied when evaluating the condition.
                              • If there is a report or user filter, the filter will not be applied when evaluating the condition.

                              If you apply a condition to a task report, task, report, and user filters are always applied when evaluating the condition.

                               

                              So, you should apply at least one Condition to a report in a task. Before to create the report for each user, Qlik NPrinting evaluates the condition with the filters and only if it is met it will generate the report and send the email.

                               

                               

                              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 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: NP17 Conditional Task: Don’t send email if no data?
                                  Francesco Menin

                                  Hi Ruggero,

                                  We're encountering the exact same problem with conditions on the same NPrinting version.

                                   

                                  - We don't have a filter on the task

                                  - We don't have a filter on the report

                                  - We have filters by user

                                  - We have a condition on the Report in the Task

                                   

                                  The condition is of the type: the chart .... has values.

                                  The chart is exported with empty tables.

                                   

                                  It looks like the condition is evaluated before applying filters (my best guess is that content resolution means apply filters).

                                  task_execution.png

                                   

                                  Best,

                                  Francesco

                                    • Re: NP17 Conditional Task: Don’t send email if no data?
                                      Ruggero Piccoli

                                      Ciao Francesco,

                                       

                                      I tested your configuration and reports for users that don't met the condition are not produced and not sent.

                                      I suggest:

                                      - check all the production chain: users, filters, connections etc to be sure that all is ok

                                      - check also the Qlik NPrinting logs to see if there are some useful mesagges

                                      - open a support ticket because I'm not able to reproduce your issue so I cannot deeper investigate

                                       

                                       

                                      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 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: NP17 Conditional Task: Don’t send email if no data?
                              Chris Wellington

                              Thanks,  rpc, the upgrades solved our problem. 

                              It may not be the cleanest approach, but I've created filters at the user level and then conditions at the report level within the task (that data exists, basically). With that combination, users only get a message if there is data relevant to them and they see just that data in their report. It's a little more nuanced so that the user gets one of several different emails depending on whether their tasks are up to date, almost due, or overdue.

                                • Re: NP17 Conditional Task: Don’t send email if no data?
                                  Jonathan Zaid

                                  I have been using this technique as well. Unfortunately beginning with the Apr 2018 release this no longer works. The message will be sent anyway with an error along with an error message.

                                  I opened a case with Qlik Support and the answer was that the condition/filter should NEVER have worked and the current functioning is the way is should work. I was very disheartened to find that there is no longer any way to avoid sending an email to a user based on a user filter, report condition as we previously did.

                                  I also noted that the documentation is written very poorly.

                                   

                                  > If there is a task filter, the filter will be applied when evaluating the condition.

                                  > If there is a report or user filter, the filter will not be applied when evaluating the condition.

                                  If you apply a condition to a task report, task, report, and user filters are always applied when evaluating the condition. 

                                  [What does this mean?]

                                    • Re: NP17 Conditional Task: Don’t send email if no data?
                                      Ruggero Piccoli

                                      Hi,

                                       

                                      > If there is a task filter, the filter will be applied when evaluating the condition.

                                      The condition will be evaluated with the dataset that results after the task filters application. If the task condition is not met the execution is stopped.


                                      > If there is a report or user filter, the filter will not be applied when evaluating the condition.

                                      The task condition is evaluated without using the report and user filters. Report and user filters will have no influence on task condition result.


                                      > If you apply a condition to a task report, task, report, and user filters are always applied when evaluating the condition.

                                      If you apply a condition to a report in a task (instead of applying it to the task) all filters applied to task, report and user will be calculated before to evaluate the condition. So the condition is evaluated with the dataset that results after the application of all filters.

                                       

                                       

                                      Best Regards,

                                      Ruggero

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

                                      When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. 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: NP17 Conditional Task: Don’t send email if no data?
                                        Ruggero Piccoli

                                        Hi,

                                         

                                        April 2018 is working as previous.

                                        In my opinion if the mail is sent you have to check:

                                        - if there are attached or embedded other reports that are not under condition. If yes the mail is sent.

                                        - if the email contains an error message. It there is an error in calculating the result of filters the email could be sent.

                                         

                                         

                                        Best Regards,

                                        Ruggero

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

                                        When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. 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: NP17 Conditional Task: Don’t send email if no data?
                                            Jonathan Zaid

                                            Thanks for your reply and I have a few points to add.

                                             

                                            Now that you "explained" the documentation, the last phrase is clearer. I think you might want a semicolon instead of a comma. (see below)

                                             

                                            "If you apply a condition to a task report; task, report, and user filters are always applied when evaluating the condition."


                                            or better:

                                            "If you apply a condition to a report in a task; task, report, and user filters are always applied when evaluating the condition."



                                             

                                            Secondly, last month I had a screen sharing session with a Qlik support engineer who is the Nprinting support expert. He told me, even after looking at the documentation together, and looking at my task and report, that there was no way I could do what I wanted, i.e. not have the report send an email even if the condition failed.

                                            I think support should have a clearer idea of how conditions & filters work in Nprinting tasks.

                                             

                                            Lastly, the issue, which the support engineer didn't discover, but I figured out, was that what was happening that some of our data changed and the filter in one particular case was being set to a value that doesn't exist. In this case the email is being sent anyway along with an error message. I wrongly attributed this to the Apr 2018 release which unfortunately was concurrent with the change in our data.

                                             

                                            The task error is:

                                            Failed generation of report 2e826ac3-ac37-48b6-94a9-a2126cd98013 for user fb38b267-dcfd-4814-b6bb-63c2a8e73773. ERROR: Cannot apply filter Filters: [Fields: [Name: F\IOEmployeeCode, ConnectionId: 7febc23c-1903-450d-94b3-ae28a2f83de8, Values: [String:KABCDEFGH], Override: False, Void: False], Void: False], Bookmark: , Void: False to current document data. Requested fields with evaluates are:

                                              • Re: NP17 Conditional Task: Don’t send email if no data?
                                                Ruggero Piccoli

                                                Hi,

                                                 

                                                I'll send your suggestions to the documentation team and your feedbacks to the support team..

                                                 

                                                Note that in recent releases we did lot of improvements on the filters management.

                                                 

                                                 

                                                Best Regards,

                                                Ruggero

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

                                                When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. 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: NP17 Conditional Task: Don’t send email if no data?
                                                  Gavin Kite

                                                  Hi Jonathan

                                                   

                                                  Are you saying that if you get this error then there is nothing that can be done to stop the email going out albeit without a report attached? I get this exact error but have a condition set to check if chart has values so am confused as to why i get this error and the condition seemingly resolves to true and the email is sent. Surely this error means that the filters have not found any results so therefore the condition should resolve to false and the email shouldn't go out? Or have I missed the point?

                                                   

                                                  Thanks

                                                   

                                                  Gavin

                                                    • Re: NP17 Conditional Task: Don’t send email if no data?
                                                      Ruggero Piccoli

                                                      Hi,

                                                       

                                                      If the filters are correct you have no issues. Filters will return the right dataset, it will be used to evaluate the condition.

                                                       

                                                      I thinks the error is generated by a wrong filter combination and that latest versions manages better errors like this.

                                                       

                                                       

                                                      Best Regards,

                                                      Ruggero

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

                                                      When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. 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: NP17 Conditional Task: Don’t send email if no data?
                                                        Jonathan Zaid

                                                        I think Ruggero answer it pretty well. If you have a condition and it is false for all reports included in the task, then it won't send out the email. My problem was, due to some changes in the underlying data, the user filter I was applying was actually no longer a valid filter, i.e. the value specified in the filter was no longer in the Qlik Dataset. So Qlik would not even have the selection possible. NPrinting, justly, reports an error since its an impossible filter setting. I think it would be nice if it didn't send an error email to the final user, rather than the NPrinting admin, but I guess by sending to the end user, it does make the Nprinting developer/admin more responsive

                                                          • Re: NP17 Conditional Task: Don’t send email if no data?
                                                            Ruggero Piccoli

                                                            Hi,

                                                             

                                                            I agree. From a point of view it is better not to send the email, but from another not sending the email in case of filter errors means that the final user knows that something went wrong. If Qlik NPrinting doesn't send the email it means that the final user can interpret this as "there are no data" when the real reason is a filters error.

                                                             

                                                             

                                                            Best Regards,

                                                            Ruggero

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

                                                            When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. 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.