Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

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)
19 Replies
Ruggero_Piccoli
Support
Support

Hi,

Now we know better your scenario and your goal. The information that reports need to be printed is very important. 

Instead of using conditions and cycles you can create a straight table in the source app. In that table you insert only the recipients who has data, for example salesman with sales in the month. Refresh the connection metadata, open the Qlik NPrinting Designer and create a level by using that straight table. Insert the content of the report in the newly created level. 

When you will generate the report you will get a distinct value of the level only for recipients who have data in a single file instead of many so it will be easier to be printed because you have to send it to the printer only one time.

The content of each level will be filtered by the recipient in the table row.

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

Hi there,

Thanks again for your response.  The reports are already set to cycle by agent code if that's what you mean?

 

Ruggero_Piccoli
Support
Support

Hi,

I'0m suggesting to switch from cycling by agent with the condition, that creates many different files, to using a level by agent but not created by using directly the agent field, but created by using a straight table that has one row for each agent that did sales. This will create a single file, simpler to be printed, with a level value only for agents with sales.

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.
Digvijay_Singh

My suggestion is somewhat similar to what @Ruggero_Piccoli , I don't know much about using straight table as a cycle field, what I am suggesting is to create a modified agent code field in the script but only keeping agents in that field having data for the current month.

James246
Contributor II
Contributor II
Author

Thanks again.  Just to clarify, the source exhibit is already a table.   And "Agent" in this context could have multiple rows based on a number of transactions (or none at all of course).

One of the earlier respondents suggested adding a chart and using the "Contains Values" method.  I tried this but it still doesn't work.

It seems to me that nPrinting doesn't use the field to cycle as expected during this process and simply looks to see if the chart (or table) has data in its unfiltered state., regardless of the Agent code it is looking at in the cycle.  Which to me seems counter-intuitive and contrary to what you'd expect for what are fairly standard reporting processes.

 

 

Lech_Miszkiewicz

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.
Ruggero_Piccoli
Support
Support

Hi,

When we speak about cycles in Qlik NPrinting we mean this https://help.qlik.com/en-US/nprinting/May2021/Content/NPrinting/ReportsDevelopment/Cycling-your-repo.... If you add a field to a cycle you will get a different report file for each distinct value of the added field. It doesn't matter if for some values of the added field there are not values, you will get the related report file in any case. Each report file will contain data filtered for the selected value of the field plus all other applied filters. 

You don't want files for agents that have no data because you want to print them so you added a report condition that checks if a chart has data. In this case you have to apply the condition to the report https://help.qlik.com/en-US/nprinting/May2021/Content/NPrinting/ReportsDevelopment/Conditions.htm#an...

If you want to print the report maybe you don't need to have them in different files, but you can have a single file with different pages by agent and only for the agents that have data. This is way I suggested to create a new straight table with a row only for each agent that have to be available on the printed report. For example a table with a column by agent and one with the amount of sales. Then use that table to create a level in the report and insert the content you want to print, and a page break, inside the level. Qlik NPrinting will apply the filters, for example, a filter for the year and month,  the level table will contain only rows related to agents with sales on the filtered month so the report will have the content in the level only for those agents an you don't need to use a condition. You will get a single report file so you will not need to open and send to print many different files. 

I hope it is more clear now.

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

Thank you, Lech.  Ironically, I had tried to make this work using 'Advanced Search' before looking at conditions but without success.

Now that I think I've established from the other posters that 'Conditions' will not give me what I need, I have had another look at using Advanced Search.

Much like the example in your link, I am using an Advanced Search formula like this:  =SUM([TRANS_AMT])>0

along with Agent Code as the Name of the Field, however it is still not working as desired.

There are other filters also in the report to select the correct reporting month.

Is it possible that the filters are not interacting correctly?  Other than that, I cannot see why this does not work.

Thanks,

Lech_Miszkiewicz

Well - it is hard to say without seeing your model and your filters.

I would open Qlik Sense and simply apply all task filters/selections and report filters/selections and then I would try to apply advanced search filter/selection (directly on Qlik Sense filter pane or table) on Agent field to see what gets filtered.

Depending on your data model it may behave differently. Example from top of my head is if you are using data islands tables + set analysis to filter periods. That would not intersect with agent filter you are applying.

It is hard to say what is not working and why without looking at your data model and all elements. 

As an exercise we may as well try to do mockup or sample app, attach it here and do "case study" . If you would be able to attach such app which would mimic your data model to some extend we can give it a go.

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.
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).