Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

send emails only when chart is not empty

Hello
got an NPrinting report (Excel format in template editor)
the publishing task send email to a group of users; each user has his own filter defined
for some users the chart is empty but that user still receives email with empty excel attachment and only headers of the table appear
how can I make NPrinting not to send email to the user when the report is empty?
kindly advise 

I can walk on water when it freezes
Labels (2)
1 Solution

Accepted Solutions
Ruggero_Piccoli
Support
Support

Hi,

I replicate your scenario in my installation and it works as expected: the user that doesn't met the condition doesn't receive any email. Instead the user that met the condition receive the report.

If I add an unconditioned report the user that doesn't met the condition receives an email with only one report and no error messages.

So I think you have something hidden in the report that cause its generation. Check the Task Executions page and you will see something like:

Ruggero_Piccoli_0-1646653117057.png

for users that should not met the condition.

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

7 Replies
Ruggero_Piccoli
Support
Support

Hi,

You could use conditions that are explained in details at https://help.qlik.com/en-US/nprinting/May2021/Content/NPrinting/ReportsDevelopment/Conditions.htm. There are also some old conversations about them here in the community.

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.
ali_hijazi
Partner - Master II
Partner - Master II
Author

ali_hijazi_0-1646408289953.png

I've added the above rule; but this means if the report as a whole contains values then run; am I wrong?
what I want is that if the filters on each user return empty report then do not send the email to that particular user
with this condition added some users still get emails containing an attachment with empty chart

I can walk on water when it freezes
Ruggero_Piccoli
Support
Support

Hi,

So you have to apply the condition to the report in the publish task, not to the publish task:

Ruggero_Piccoli_0-1646408897416.png

Then set the email distribution error to:

Ruggero_Piccoli_1-1646408936106.png

With this configuration users with empty reports will not receive the email.

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.
ali_hijazi
Partner - Master II
Partner - Master II
Author

still some users receive emails with reports without data attached

first I created the condition as follows:

ali_hijazi_0-1646410791485.png

then I added the condition to the report in the task->report as you told me

ali_hijazi_1-1646410861118.png

in the settings:

ali_hijazi_2-1646410943832.png

 

I can walk on water when it freezes
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @ali_hijazi 

Are you suppressing 0 values in the Qlik Sense table (used for condition evaluation) settings ?

The process is: 

  • NPrinting starts task and applies task filters and task conditions (if there are any)
    • Starts generating report (applies report filters if there are any)
      • Checks user filters and applies them
      • Checks condition for those  and all earlier applied filters. This means it checks if the condition is met. If you set the condition on one particular chart that condition is checked against only that one particular chart and not any others used in the report.
      • regarding comment i made around "suppress 0 values" - based on my experience table has to return no records, meaning that if there is a row with nulls and 0 values then condition will not be met as there is still a record in it. 

Further investigation of your issue would require us to:

  • look at your chart dimensions and expressions (the one used for condition evaluation) + all settings used in it.
  • look at filters for users which should not receive report but still do receive it
  • apply those filters directly in Qlik Sense and check if they are applied properly
  • check if user filters are properly configured - it is possible that your user filters are disregarded maybe because of wrong filter datatype used?

cheers

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
ali_hijazi
Partner - Master II
Partner - Master II
Author

Hello @Lech_Miszkiewicz 
yes I suppressed the zero values in the chart;
and users who meeting the filter condition get emails with data in the attached chart
but users whose filters return no data still receive emails with the attached chart empty

following is a screen shot of an attachment with empty rows and the next for an attachment whose user's filter return data

 

ali_hijazi_0-1646490896011.pngali_hijazi_1-1646490941645.png

 

I can walk on water when it freezes
Ruggero_Piccoli
Support
Support

Hi,

I replicate your scenario in my installation and it works as expected: the user that doesn't met the condition doesn't receive any email. Instead the user that met the condition receive the report.

If I add an unconditioned report the user that doesn't met the condition receives an email with only one report and no error messages.

So I think you have something hidden in the report that cause its generation. Check the Task Executions page and you will see something like:

Ruggero_Piccoli_0-1646653117057.png

for users that should not met the condition.

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.