Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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).
One way to go about this is to:
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...
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,
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?
Re my previous comment. It's all good, as I've reloaded the metadata. Trying the solution itself next. Thanks.
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!
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.
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
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.
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.