Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with accumulative columns

Hi,

I have a problem with a pivot table.

The value of the columns is the value of the column plus the accumulative value of columns before. I try this with the function Before but I don't obtain the result I need.

The values of original expression are:

Month 1 2 3 4 5

1000 2000 3000 4000 5000

What I get:

Month 1 2 3 4 5

1000 3000 5000 7000 90000

But what I need is:

Month 1 2 3 4 5

1000 3000 6000 10000 15000

I need your help, any ideas?

Thank you very much,

O.Iglesias.

error loading image

1 Solution

Accepted Solutions
mike_garcia
Specialist
Specialist

This is what you need:

=RangeSum(Before(Sum(IMPORTE), 0, ColumNo()))


What it is telling QlikView to do is: Evaluate Sum(IMPORTE) in all previous columns of my table, starting from this point (zero), and a for a number of x Columns (Result of ColumnNo()).

Hope this Helps.

Mike.

Miguel García
Qlik Expert, Author and Trainer

View solution in original post

3 Replies
mike_garcia
Specialist
Specialist

This is what you need:

=RangeSum(Before(Sum(IMPORTE), 0, ColumNo()))


What it is telling QlikView to do is: Evaluate Sum(IMPORTE) in all previous columns of my table, starting from this point (zero), and a for a number of x Columns (Result of ColumnNo()).

Hope this Helps.

Mike.

Miguel García
Qlik Expert, Author and Trainer
mike_garcia
Specialist
Specialist

[quote user="Mike García"]Evaluate Sum(IMPORTE) in all previous columns of my table, starting from this point (zero), and a for a number of x Columns (Result of ColumnNo()).

Sorry, I missed something: "AND sum all the results". So it should say:

Evaluate Sum(IMPORTE) in all previous columns of my table, starting from this point (zero), and a for a number of x Columns (Result of ColumnNo()) AND sum all the results.

Mike.

Miguel García
Qlik Expert, Author and Trainer
Not applicable
Author

Thank you very much, Mike, it works!

Smile