Skip to main content

Qlik NPrinting: Create a sorted stacked bar chart in PixelPerfect

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Ruggero_Piccoli
Support
Support

Qlik NPrinting: Create a sorted stacked bar chart in PixelPerfect

Last Update:

Apr 19, 2022 4:53:06 AM

Updated By:

Sonja_Bauernfeind

Created date:

Sep 14, 2018 6:53:34 AM

The goal of this document is to create a sorted and stacked bar chart by using PixelPerfect. See Fig 1.

Fig 1Fig 1

 

 

Environment:

Qlik NPrinting 

 

The original source QlikView object contains two dimentsions (Country and Salesman) and one measure (sales):

Sonja_Bauernfeind_1-1650358065047.jpeg

 

  1. First, add a measure with the sum of the sales for each salesman. We will use it to sort the chart. Create a new expression with the formula sum(TOTAL <Salesman> Sales)

    Sonja_Bauernfeind_2-1650358084900.jpeg

     

  2. The final source chart will looks like the following:

    Sonja_Bauernfeind_3-1650358094346.jpeg

     

  3. Save the .qvw and create a Qlik NPrinting connection to it or refresh the cache if you already created the connection. Create a new PixelPerfect template add the cource QlikView table in the Tables node and add a native chart.
  4. Select Side by side bar stacked chart type and press Next two times.

    Sonja_Bauernfeind_4-1650358139855.jpeg

  5. Remove all the data series a part Series 1, then click on Series Options tab

    Sonja_Bauernfeind_5-1650358165693.jpeg

     

  6. To order the bars in descending order based on the total sales of each salesman set Point sort order to Descending and Sort points by Values by using the related drop down menus. Unflag the Show in legend check box. We will use the Series 1 only to order the bars in the final chart, but the series itself will be hide so we don't want to show it in the legend.Click on Next.

    Sonja_Bauernfeind_6-1650358194232.jpeg

     

  7. Select the Series Binding tab. Select Salesman in the Argument drop down menu and the new sum total field in the Value drop down menu.

    Sonja_Bauernfeind_7-1650358215909.jpeg

     

  8. Open the Auto created Series tab ad set:
    • The source chart in the Data Member drop down menu
    • Country as Series. This will divide each bar by country
    • Salesman as Argument. This will create a bar for each salesman
    • Sales as value so the portion for each country in each bar will be calculated based on the sales value
  9. Click on Next until you reach the Series View section.

    Sonja_Bauernfeind_8-1650358273216.jpeg

     

  10. Set 0,1 in the Width option to have the narrowest possible bars.

    Sonja_Bauernfeind_9-1650358293500.jpeg

     

  11. In the Appearance tab set Transparency to 255. This will made the bar 100% transparent.

    Sonja_Bauernfeind_10-1650358311774.jpeg

     

  12. In the Border tab remove the flag in the Visible check box to hide the bar borders. Click Next.

    Sonja_Bauernfeind_11-1650358331203.jpeg

     

  13. In the Point Labels section remove the flag to the Visible check box for the Series 1. We hiddin the series bars, we need also to avoid to show related numbers.

    It is your choiche to remove the point labels also for the auto generated series.

    Sonja_Bauernfeind_12-1650358361280.jpeg

     

  14. Click on Finish. Resize the chart and run a report preview.

    If the bars in the report are not in the correct order go back to Data - Series Binding and be sure that Series 1 is correctly configured.
Labels (1)
Comments
DaniloMatos
Contributor
Contributor

Great job. 

Do you know how to keep the colors? For example, if one of the countries has no data, the others countries keep their colors?

In my case, I have a chart, in QlikView, with one dimension and one measure (the colors are calculated in the background color). I want to keep the same behavior in a pixel perfect chart.

Version history
Last update:
‎2022-04-19 04:53 AM
Updated by: