Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

dirkoomscegeka
New Contributor II

NPrinting 17 - Levels on fields or charts with empty values when cycling

How to skip sections/levels in the report if for a given cyclic value there are no related values?


Struggling with this for some time now;

I have a build a perfectly working report but when I enable cycling on customer it fails because there are levels created for which some customers have no value.

Simplified example using QV12 and NP17 - September 2017:

Source Data:

Name Ordernumber InvoiceID
CustA245624555643
CustA245624565432
CustA623452355643
CustA623452365432
CustB 00009
CustB 66535
CustC

NPrinting Report:

When cycling is disabled it shows me one report with the list of invoices and the list of orders without any errors.

If I enable cycling on the customer field I get an error.  (Can not handle void...)

I tried the same with using the invoice chart and the order chart as level and got a different error (specified cast not valid).

Desired result is to see a report for each customer, where if there are invoices I see "Invoice list" with the invoices and if there are no invoices this section is skipped.

Thanks in advance for any reply's or tips how to handle this.

5 Replies
lech_miszkiewic
Honored Contributor III

Re: NPrinting 17 - Levels on fields or charts with empty values when cycling

Create a Chart with values, suppres null and zero values for it and use chart in Level node instead of field..

thats it.

regards

Lech

dirkoomscegeka
New Contributor II

Re: NPrinting 17 - Levels on fields or charts with empty values when cycling

I tried exactly that at first.  That's giving me the Specified cast is not valid.

See my charts below when filtered on one of the customers who does not have invoices & orders;

As soon as I add these charts to my report levels, the error pops up when clicking (html) preview.

lech_miszkiewic
Honored Contributor III

Re: NPrinting 17 - Levels on fields or charts with empty values when cycling

Ok i got it - you are right as you still use CYCLE functionality on FIELD to create reports for each cutomer..

Well i would create an aggregate amount in script and flag customers with amout > 0, or even create dedicated Customer DImension only for Customers with Amount > 0 and cycle through this additional dimension

cheers

Lech

dirkoomscegeka
New Contributor II

Re: NPrinting 17 - Levels on fields or charts with empty values when cycling

You got the problem correct Lech,

But thing is, I do not want to skip customers without orders. I want to create a report for each customer, displaying his invoices. And if there are orders, add a list of the orders on that same report.

Only solution I see is to use a report for customers with orders and a report for customers without orders. And use some dedicated field to cycle through each set of customers.

But I'm hoping there is a better approach.

Thx already,
Dirk

dirkoomscegeka
New Contributor II

Re: NPrinting 17 - Levels on fields or charts with empty values when cycling

Found a solution for this I'd like to share;

You can link a 'formatting rule' in the property tab of a detail report inside your report.

Making this detail report invisible based on a Formula!  

Set default 'visible = no, create formatting rule with a condition 'vShowChart = 1' or something and set in this rule the visible property to yes

Once this is done I made sure my charts and fields used in the sublevels both have no null values and no empty charts when cycling. (displaying 0 or ' ')

In my case the source qvw is only used to source the report so for me it was not a problem to have 0 lines or ' ' values in the charts in the qvw report, because they will be hidden in the NPrinting reports.

Community Browser