Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

partial sum not showing for expressions with aggr(sum(...

Hello

I got a pivot table with 4 dimensions and 3 expressions

in the third expression I'm using the aggr function to calculate the sum of fields up to the third dimension as follows:

aggr(

sum

(

{1

<

    JvdDataSource = {'SAP'},

Year = {$(=vCurrentYear)},//{$(=max(Year))},

Month = {">=$(=min({<Year={$(=vCurrentYear)}>} Month)) <=$(=max({<Year={$(=vCurrentYear)>} {$<}>} Month))"}

// Month = {">=$(=min({<Year={$(=max(Year))}>} Month)) <=$(=max({<Year={$(=max(Year))>} {$<}>} Month))"}

>

} BAJVDetails.localDebitAmount - BAJVDetails.localCreditAmount)

,BAFinanaicalCategory1.FinancialCategory1.Name)

under the 3rd dimension I checked the Show Partial sum; however this partial sum is not showing for the third expression in which I'm using the aggr function

please advise

I can walk on water when it freezes
1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Try this expression.

   Sum(Aggr(Sum(Credit-Debit),C))

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

3 Replies
johnw
Champion III
Champion III

I haven't tried to understand your expression, but the general form for "sum of rows" subtotals in a pivot table is like this:

sum(aggr(YourExpression,YourDimensions))

You seem to be missing the initial sum().  That would then be expected to work on the individual rows, but return null for subtotals.  So I suspect that's your problem.

ali_hijazi
Partner - Master II
Partner - Master II
Author

my expression is intended to calculate the sum of (debit - credit) amounts

I have 4 dimensions A, B, C, and D

in my expression I put

aggr(sum(debit-credit), C)

the other expression is similar to the above but without the use of aggr

in the presentation tab I checked the show partial sum for dimension D

so the partial sums are shown for the columns under all expressions except for the one in which I added the aggr

if I remove the aggr function the partial sum is shown

I can walk on water when it freezes
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Try this expression.

   Sum(Aggr(Sum(Credit-Debit),C))

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!