Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us at Qlik Connect 2026 in Orlando, April 13–15: Register Here!
cancel
Showing results for 
Search instead for 
Did you mean: 
paolo_cordini
Partner - Creator
Partner - Creator

Pixel Perfect Cross Tab Global Totals

In the "Cross Tab" object of Pixel Perfect template designer, it seems not possible to have a global total defined, for instance as "sum(x)/sum(y)".
In fact, the total is always calculated as aggregation of the details rows.
This is an important limitation, as Cross Tab can not be used with percentages or ratios.

The only workaround seems to suppress the total rows and manually add totals labels after or before the object.
Does anyone has smarter solutions?

Thanks

Paolo

Labels (1)
1 Reply
Greg_Taffer
Support
Support

You are correct that the Pixel Perfect Cross Tab object in NPrinting/Qlik automatically aggregates detail rows rather than calculating a complex ratio (like a global) at the total level. The limitation arises because it performs a simple Sum of the results in the cells above.
 

Here are some more robust solutions to handle ratios/percentages in Cross Tab totals, moving away from manual labels. 

 

1. The Best Practice: Pre-calculate in Qlik Sense/View

The most reliable solution is to calculate the final percentages or ratios within your Qlik script or data model before bringing the data into NPrinting.

  • Why: NPrinting is designed to report data, not perform complex analytics.
  • How: In your Qlik load script, calculate RatioField = [Numerator] / [Denominator]. Then, in Pixel Perfect, simply use Sum(RatioField) or Avg(RatioField) if appropriate, or use the pre-calculated total row from Qlik.

2. Solution: Create a "Calculated Field" in the Designer

You can create a new formula within the Pixel Perfect designer that calculates the ratio, rather than using the default sum behavior.

  1. Open the Level node in the Pixel Perfect template.
  2. Right-click on the data row (Table Row) and select Add a Calculated Field.
  3. Set the expression to your formula, for example: [FieldA] / [FieldB] (using the data sources).
  4. Drag this new calculated field into the cell where the percentage is needed.
  5. Crucial Step: Select the field, go to the property panel, and ensure the summary behavior is set to handle the formula rather than just Sum. 

3. Solution: Use the BeforePrint Event

For more advanced control, you can use the BeforePrint event of the specific Total Cell to calculate the ratio based on raw data.

  1. Select the Total Cell cell.
  2. Open the Scripts section in the Properties panel and select BeforePrint.
  3. Use the Summary function to get the values from the raw data and calculate the ratio.
    • Example: e.Value = GetCurrentColumnValue("Num") / GetCurrentColumnValue("Denom") (Syntax varies slightly based on the specific DevExpress version underlying NPrinting).

Summary Checklist

  • Avoid: Using the default Sum function on a pre-calculated percentage (e.g., Sum(0.1 + 0.2 + 0.3) will give 0.6 instead of the required 0.2 average).
  • Use: Pre-calculated fields or calculated formulas inside the template.