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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Dayna
Creator II
Creator II

Round Up (Ceil) on sub total of a Pivot Table

Hello All,

I'm hoping you can help me, I'm trying to apply a rounding on the sub total of a pivot table (which is on the field 'ih_nbr') by using 'ceil', but the aggr is applying to one of the rows (leaving the others blank) rather than applying it on the total.

The calculation I'm trying at the moment looks like this:

ceil(aggr(sum(if(ad_zone=1,(idh_qty_inv/idh_conv), (idh_qty_inv/idh_conv)/2)),ih_nbr))

But the outcome is like the following (the pallet spaces column is without the aggr, but the value the sales order should display at).

Sales OrderInvoice NumberPallet Spacesceil(aggr(sum(if(ad_zone=1,(idh_qty_inv/idh_conv), (idh_qty_inv/idh_conv)/2)),ih_nbr))
SO231865IN19103916
SO231865IN1910412668
SO231865IN19110726
SO231865Total6868
SO232032IN1911381844
SO232032IN1911398
SO232032IN19130817.36666667
SO232032Total43.3666666744

Any help would be greatly appreciated!!

Kind Regards,

Dayna

10 Replies
anbu1984
Master III
Master III

Are you getting any numbers without Ceil()?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I don't understand what you're trying to do. Why do you think you need to use the aggr function? What are you trying to calculate? Can you post a qlikview document that explains what you want to do?


talk is cheap, supply exceeds demand
Dayna
Creator II
Creator II
Author

Anbu, I'm getting the same amount of numbers if I don't use ceil, so it's something to do with the aggr statement.

Gysbert, I'm trying to apply a rounding on the calculation for the sub total of ih_nbr - I believe I need the aggr, so it can aggregate the calculation for the ih_nbr field. I would like to show the calculation for each line, but for the total, I want to round it up.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The sum function does the aggregation. The aggr function doesn't. That's only necessary if you need to do an aggregation on an aggregration like calculating the maximum of sum values.


talk is cheap, supply exceeds demand
Dayna
Creator II
Creator II
Author

Gysbert,

How would you advise that I meet my objective?

Many thanks,

Dayna

sunny_talwar

I think it would be much easier to address your problem if you can post a sample application.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

What is your objective? You still haven't explained that yet.


talk is cheap, supply exceeds demand
Dayna
Creator II
Creator II
Author

Gysbert,

My objective is, that I'd like to perform my sub calculation (the sum) on each line of the table, but I'd like the sub total to be rounded up on the pivot to be rounded. If I can't do a rounding on the sub total, could you advise how to generate a sub-total without using QlikView's default functionality?

Many thanks,

Dayna

sunny_talwar

Have you explored Dimensionality() before? You can use a different expression, formatting using Dimensionality for your sub-total row.

Chart Dimensionality

HTH

Best,

Sunny