Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
triciagdaly
Contributor III
Contributor III

How to calculate totals in a separate chart

I am unable to calculate a total in a separate chart (not in the detail section) .  The reason for a separate chart is the information in the detail chart is too lengthy and totals are not easily visible and user doesn't want to scroll over to the far right but wants a snapshot glance of the totals.

Please see the attachment that describes the issue in detail.

3 Replies
whiteline
Master II
Master II

Hi.

Since you have conditions for each row in your table you just can't use simple sum to get totals. QV doesn't know wich dimensions to use for the calculation.

Use aggr function containing the dimensions needed before sum.

triciagdaly
Contributor III
Contributor III
Author

I have never used aggr function - fairly new to QlikView.  Would you be able to provide one example with the details I had previously attached?  I was able to perform one expression in the separate total chart based upon a RECEIPT_AMOUNT, so I thought I would be able to use all the dimensions.  It was

=sum  {$<

      RECEIPT_DATE = {">=$(=yearstart(*today())) <=$(#Receipt_WeekStart)"),

      Receipt_Month=,

      Receipt_Quarter=

    >}  (RECEIPT_AMOUNT)

Thank you for your help!

whiteline
Master II
Master II

Hi.

Consider you have a chart with two dimensions Dim1 and Dim2 and perform some complex calculations for each row and them sum it up for totals.

To calculate the same value without building the chart you have to use aggr function:

=Sum(aggr([Some complex expression], Dim1, Dim2))