Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
James246
Contributor II
Contributor II

nPrinting Condition to disregard blank reports

Hi

Hoping for some guidance here if possible.  I have a set a monthly reports that cycle through a set of Agent Codes and generate a report for each, regardless of whether there was any financial activity in the given month for that agent.

I am trying to add a condition that suppresses those reports that do not have any data (in the interests of saving time and paper!)

I thought the simplest solution would be to add a condition with a Rule where the relevant variable was not equal to NULL but this does not seem to work.  I have tried it using the Expression method where not equal to NULL() and other variations but it carries on cycling through all reports even if they do not have data.

Any help would be appreciated.

Thank you

Labels (2)
2 Solutions

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi James,

I was not adding anything to this conversation as it was hard to establish what was the actual issue in your case, what was your requirement, what worked and what didn't. I saw many different options and each of them had merit but also each of them was focused on different approach. Some were talking about reports without cycle, some were talking about levels and the way we could utilize table for that (but obviously this cannot be used with cycles), some were talking about conditions etc etc.. 

I will try to structure this little bit.

If your requirement is to cycle over Agent Code values and produce report only for those agent code values where there is data the only solution would be to use "Advanced search filter" to filter out "agent codes" to only those which do have data. Using "Chart has values" option in condition where your report is using cycle will not work as individual values of cycle are not evaluated in condition!

I wrote about Advanced search filters in this post: https://nprintingadventures.com/2019/06/26/nprinting-filters-part-3-advanced-search/ and I also commented on that post to explain how it works where multiple dimensions have to be filtered. 

This is the easiest approach which shouldn't require additional changes in your Qlik data model. Other approaches like creating flags are also valid, but obviously require more work.

cheers

Lech

 

 

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.

View solution in original post

James246
Contributor II
Contributor II
Author

Many thanks to everyone who contributed to resolving this dilemma.  I have now got this to work as desired using the Advanced Search option (as suggested by Lech).

View solution in original post

19 Replies
Frank_S
Support
Support

@James246

 

One way to go about this is to:

  • Add this condition to the publish task
  • Run the Publish task

The result should be that when publish task executes the user that has a certain agent code assigned to it, then the condition is applied to the published task, reports should only be sent to that user when the chart in the condition contains values.

 

Let us know if this works...

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Digvijay_Singh

A new filter field in script may help as well, something like - 

filter:

load

[Fact table keyfield]

[agent code] as [report agent code]

resident fact table

where month = current month

 

Thanks,

 

James246
Contributor II
Contributor II
Author

Thank you, Frank.  I have added a chart to the exhibit which drives the report, however nPrinting doesn't seem to be picking it up in the dropdown when I try and build the new rule.  is there another step I have to take in order for this to happen?

James246
Contributor II
Contributor II
Author

Re my previous comment.  It's all good, as I've reloaded the metadata.  Trying the solution itself next.  Thanks.

Frank_S
Support
Support

Thats correct @James246

Reloading the NP connection is indeed needed when dasbhoard/app charts are added or updated.

I've updated my original response in case others follow this thread.

Cheers!

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
James246
Contributor II
Contributor II
Author

Hi again Frank

I am not quite sure what you mean by user filter in this context.  I am the only user of nPrinting here.

The agents I referred to are simply report recipients, external to our company.

Ruggero_Piccoli
Support
Support

Hi,

Report recipients are defined as users in Qlik NPrinting also if they are external; you are sending them reports via email. So you can create filters and associate them to the related Qlik NPrinting users. 

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.
James246
Contributor II
Contributor II
Author

The reports are actually printed and physically mailed.  And we are talking at least 300 distinct agents, so I'm not sure if filtering for each one is really practical.

I'm just a little bemused, as all indications are that it should be simple to suppress a report which has no data and yet it seems to be very convoluted in reality.

Digvijay_Singh

I am not sure about the exact data model, but I feel its worth trying creating new agent code field just for reporting in the script having excluded agents not having data in the current month. Pl ignore if its not applicable in your situation.