Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Totals not correct

The totals are not matching the sum of the rows.  I have tried using AGGR, but still not working.  What I am doing wrong?

Here is the expression:

If(Sum([Budget OccSF]) > Sum(TotalSQF),
Sum(Aggr(Sum(TotalSQF),Facility,OType)),
Sum(Aggr(Sum([Budget OccSF]),Facility,OType))
)

Here is the result table.  The total for Owner is not matching the sum of the rows

 StoreYesterdayYesterday Budget 
Managed582889.82%2232479.93 
Managed616497.17%1794356.72 
Managed616592.67%1431386.71 
Managed616695.71%2156914.57 
Managed616794.83%1949440.98 
Managed616878.49%2343843.67 
Managed616994.24%1130630.75 
Managed627697.19%2227164.3 
Managed631495.07%1823194.16 
Managed634591.31%1782223.81 
Managed648193.13%2252497.44 
ManagedTotal92.06%21124133.04 
Owned74595.97%1456016.45 
Owned80096.15%2304389.92 
Owned80289.87%2153505.37 
Owned91289.58%2465275 
OwnedTotal92.64%89935658379186.74
  92.22%1966887.99 
Labels (1)
1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Usually needs the aggr-wrapping  to be on the outside of the expression to ensure that the total is equally to the sum of rows. Therefore I think your expression should be rather look like:

Sum(Aggr(
   If(Sum([Budget OccSF]) > Sum(TotalSQF), Sum(TotalSQF), Sum([Budget OccSF]),
Facility,OType))

- Marcus

View solution in original post

3 Replies
Highlighted

On the measure, you should be able to change the Totals function from "Auto" to "Sum" where it will do sum of rows.

Highlighted
Contributor III
Contributor III

It was already set to sum

Highlighted
MVP & Luminary
MVP & Luminary

Usually needs the aggr-wrapping  to be on the outside of the expression to ensure that the total is equally to the sum of rows. Therefore I think your expression should be rather look like:

Sum(Aggr(
   If(Sum([Budget OccSF]) > Sum(TotalSQF), Sum(TotalSQF), Sum([Budget OccSF]),
Facility,OType))

- Marcus

View solution in original post