Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Accumulation in a pivot table

Hi everyone,

I am facing some problems to display an accumulated amount in a pivot table. Currently, I am working on members registration (with a registration date) and i want a pivot table looking like this :

YearMonth# new members
# members from the start
2011Dec10 00020 000
2012Jan5 00025 000

Feb6 00031 000

Assuming that the first members registred on November 2011, the previous table is showing data filtered by an active selection (from Dec 2011 to Feb 2012).

My members table looks like this (without a few dimensions such as language_id, channel_id..) :

  • member_id
  • member_registration_date
  • member_count // always equal to "1"

Getting the first expression # new members is quite simple : SUM(customer_count)

Now, I want, in the second expression, the # of members from the start (ie. Nov 2011) to the end of the month. Indeed, the first line of my table (Dec 2011) should be : # new members in Nov 2011 (10.000) + # new members in Dec 2011 (10.000) = 20.000

However I tried many set analysis and expressions, I couldn't find a way to do this...

Thanks in advance for your help,

Damien

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try with this approach

     Set variable with value =Sum({1<member_registration_date={"<$(=Min(member_registration_date))"}>} member_count)

     Use this expression in pivot table

     =Sum(member_count)+Alt(Above(TOTAL [Accumulate]),vAccumulation)

     Here vAccumulation is a variable.

    [Accumulate] is expression label of above expression.

     Or you can try with this expression instead of using variable

     =Sum(member_count)+Alt(Above(TOTAL [Accumulate]),$(=Sum({1<member_registration_date={"<$(=Min(member_registration_date))"}>} member_count)))

Hope it helps

Celambarasan

View solution in original post

14 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try the following expression

=RangeSum(Above(TOTAL Sum(NewMembers), 0, Rowno(TOTAL)))

Regards,

Jagan

Not applicable
Author

Hi Jagan,

Thanks for your quick answer.

It's almost what I want but, in your expression, my table looks like this :

YearMonth# new members
# members from the start
2011Dec10 00010 000 (instead of 20 000)
2012Jan5 00015 000 (instead of 25 000)

Feb6 00021 000 (instead of 31 000)

My # new members in Nov 2011 (not part of the current selection) is not use for the calculation.

Damien

jagan
Luminary Alumni
Luminary Alumni

Hi,

The expression is correct, The first row has 10000, the second row has 5000.  So the sum of first 2 rows is 15000(10000 + 15000).  Please check your data.

Regards,

Jagan.

Not applicable
Author

Hi,

The table shows the result for a selection from Dec 2011 -> Feb 2012.

However, my data starts from Nov 2011 (10.000 new members) and I would like to have it in my table.

That's why I want to have in my first row the sum of Nov 2011 (10.000) and Dec 2011 (10.000). In the second row, the sum of Nov 2011 (10.000), Dec 2011 (10.000), Jan 2012 (5.000) and so on.

Regards,

Damien

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please attach the sample file.

Regards,

Jagan.

jagan
Luminary Alumni
Luminary Alumni

Hi,

In pivot table it is not possible to get previous month values, it is only possible to get previous row values visible in the chart.

Regards,

Jagan.

Not applicable
Author

Hi,

Ok... thanks for your research !

I'll try another way to do this...

Best regards,

Damien

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try with this approach

     Set variable with value =Sum({1<member_registration_date={"<$(=Min(member_registration_date))"}>} member_count)

     Use this expression in pivot table

     =Sum(member_count)+Alt(Above(TOTAL [Accumulate]),vAccumulation)

     Here vAccumulation is a variable.

    [Accumulate] is expression label of above expression.

     Or you can try with this expression instead of using variable

     =Sum(member_count)+Alt(Above(TOTAL [Accumulate]),$(=Sum({1<member_registration_date={"<$(=Min(member_registration_date))"}>} member_count)))

Hope it helps

Celambarasan

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi

I attached One Application. Please Check is correct or not .

Regards,

Perumal A