Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
triciagdaly
New 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
Honored Contributor II

Re: How to calculate totals in a separate chart

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
New Contributor III

Re: How to calculate totals in a separate chart

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
Honored Contributor II

Re: How to calculate totals in a separate chart

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))