Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Accumulating over one dimension

Hi guys, probably an easy one.

Given this table:

accu.PNG

I need to accumulate the measure Vekt pr row pr KODE. THe first row is added to the second, the new second value is added to the third. And so forth. But on RowNo = 25 (new KODE) it should start over again.

Pls advice.

See attached documents.

Best regards

Trond E

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Aggr(RangeSum(Above(Sum(Vekt),0, RowNo())), KODE, RowNO)

Change in Script:

Table:

LOAD RowNo() as RowNO,

  KODE as KODE1,

    EmneKode,

    Rangering,

    [=FUNNET_VEKT] as Vekt,

    [=EmneKode]

FROM

[CH08_20160218_170244.xls]

(biff, embedded labels, table is Sheet1$);

FinalTable:

LOAD RowNO,

  KODE1 as KODE,

  EmneKode,

  Rangering,

  Vekt,

  [=EmneKode]

Resident Table

Order By KODE1;

DROP Table Table;

Output:


Capture.PNG


View solution in original post

3 Replies
sunny_talwar

Try this:

Aggr(RangeSum(Above(Sum(Vekt),0, RowNo())), KODE, RowNO)

Change in Script:

Table:

LOAD RowNo() as RowNO,

  KODE as KODE1,

    EmneKode,

    Rangering,

    [=FUNNET_VEKT] as Vekt,

    [=EmneKode]

FROM

[CH08_20160218_170244.xls]

(biff, embedded labels, table is Sheet1$);

FinalTable:

LOAD RowNO,

  KODE1 as KODE,

  EmneKode,

  Rangering,

  Vekt,

  [=EmneKode]

Resident Table

Order By KODE1;

DROP Table Table;

Output:


Capture.PNG


Not applicable
Author

Thank you very much!

Best regards

Trond Erik

rubenmarin

There is also a chart solution, at least for straight table (where you can hide columns)