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: 
vikqlik17
Contributor
Contributor

Qlik Sense - NPrinting - How to hide the object ( as an image ) if no data available

Hi All, 

I have an excel template , displaying the line chart as image.

I am using levels ( ex: Product ) on which the line chart displays for various products.

 

<product>

<PKjRKr>

</product>

 

Some products do not have the data for "<PKjRKr>" in it, for which the image displays with no data, But I do not want to display that image at all if there is not data.

12.png

 

 

 

 

 

 

 

I tried to use the formula named "display" defined as "=if ( $(vMeas) = 0 , '' , '<PKjRKr>' ) " . When I click the preview, It just shows the "<PKjRKr>" but not the image.

 

<product>

<display>

</product>

 

Am I missing anything here ? Any suggestions would be appreciated.

Qlik NPrinting  Qlik Sense Enterprise on Windows 

Thanks.

Vikram

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi - this obviously is completely different requirement and the answer depends on whether you can have situation where chart1 will have data and lets say chart 2 will be empty. 

If that is the case then that is an issue which needs to be treated separately by introducing another level - I have not tested this, but I would assume this possibly could work:

<PZcJsq_Level>
    <Product_1>
      <Level Chart 1>
        <chart 1>
      </Level Chart 1>
      <Level Chart 2>
        <chart 2>
      </Level Chart 2>
      <Level Chart 1>
        <chart 3>
      </Level Chart 3>
</PZcJsq_Level>

 

So the way I would do it would by ensuring that your table used for PZcJsq_Level has Product as dimensions and all measures from charts 1,2 and 3, and three tables for inner levels would only have product as dimension and only respective measure from the chart which sits inside.

As I said - I have not tested this so I am not 100% sure what the outcome will be, but you can give it a go and try.

Important - Introducing those extra levels may increase report generation time so be aware of that.

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.

View solution in original post

3 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

yes- you are missing one important factor.

Instead of using field as level use table as level and in this table with dimension product and some measure. That measure needs to work so if there is no data then table is empty. Make sure you disable show null in dimension and you disable show 0 values in AddOns Properties of the table.

When such table is used as level it will only "cycle" through products having data and therefore your empty image will not be created.

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.
vikqlik17
Contributor
Contributor
Author

Thank you for your suggestion , And forgot to mention that I am actually using the field from the table (This table , I am using for sorting my products in a custom order ).I am also using other charts as well as per the following sample code.

<PZcJsq_Level>
    <Product_1>
        <chart 1>
        <chart 2>
        <chart 3>
        <display>
</PZcJsq_Level>

So, Do you want me add one more measure to the table that is same as the one that I am using to display the line chart ?

Thanks.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi - this obviously is completely different requirement and the answer depends on whether you can have situation where chart1 will have data and lets say chart 2 will be empty. 

If that is the case then that is an issue which needs to be treated separately by introducing another level - I have not tested this, but I would assume this possibly could work:

<PZcJsq_Level>
    <Product_1>
      <Level Chart 1>
        <chart 1>
      </Level Chart 1>
      <Level Chart 2>
        <chart 2>
      </Level Chart 2>
      <Level Chart 1>
        <chart 3>
      </Level Chart 3>
</PZcJsq_Level>

 

So the way I would do it would by ensuring that your table used for PZcJsq_Level has Product as dimensions and all measures from charts 1,2 and 3, and three tables for inner levels would only have product as dimension and only respective measure from the chart which sits inside.

As I said - I have not tested this so I am not 100% sure what the outcome will be, but you can give it a go and try.

Important - Introducing those extra levels may increase report generation time so be aware of that.

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.