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

How to calculate accumulate data from excel based on another column?

Hi everyone,

I'm new to the qlikview world and stuck on this problem I have:

I have three data (blue below) in Excel and I want to display in QVW as below with the new calculated column.

"Accumulate Credit" is calculated based on Agent and ascending Years.

I've tried:

1.rangesum(Credit, 0,rowno())

2. rangesum(sum(Credit),0,rowno())

3. rangesum(Credit, peek('Acc_Credit') as Acc_Credit

I'm really new at this so I'm not sure what is the exact difference for those functions. Any help would be great!

Thanks!!

Agent

CreditYearAccumulate Credit
A120101
A220123
A320136
B519975
B22003

7

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Table:

LOAD RowNo() as RowNum,

  Agent,

    Credit,

    Year

FROM

[https://community.qlik.com/thread/237796]

(html, codepage is 1252, embedded labels, table is @1);

FinalTable:

LOAD *,

  If(Agent = Previous(Agent), RangeSum(Credit, Peek('Acc_Credit')), Credit) as Acc_Credit

Resident Table

Order By Agent, Year;

DROP Table Table;

Capture.PNG

View solution in original post

3 Replies
sunny_talwar

Try this:

Table:

LOAD RowNo() as RowNum,

  Agent,

    Credit,

    Year

FROM

[https://community.qlik.com/thread/237796]

(html, codepage is 1252, embedded labels, table is @1);

FinalTable:

LOAD *,

  If(Agent = Previous(Agent), RangeSum(Credit, Peek('Acc_Credit')), Credit) as Acc_Credit

Resident Table

Order By Agent, Year;

DROP Table Table;

Capture.PNG

Not applicable
Author

Thank you so much for the reply, it worked great!!!

sunny_talwar

Awesome!!

Please close the thread by marking the correct response.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny