Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,Everybody,I'm a new fish here,
Latest I got a problem and hopes for everyone's help
In QlikView, I've got a random table like this
--------------------------------------------------------------------
COLUMN1 COLUMN2 COLUMN3
A 10
A 20
A 30
B 20
B 5
B 25
C 10
C 12
C 22
----------------------------------------------------------------------
Now I want to account for result like this:
----------------------------------------------------------------------
COLUMN1 COLUMN2 COLUMN3
A 10 10
A 20 30
A 30 60
B 20 20
B 5 25
B 25 50
C 10 10
C 12 22
C 22 44
----------------------------------------------------------------------
So how can I do to solve this problem.
Create a straight table
Dimension =
Column1
Column2
Expression
RangeSum(Above(SUM(COLUMN2),0,RowNo()))
UPDATE : You can do the same at script level
Temp:
Load * Inline
[
COLUMN1, COLUMN2
A, 10
A, 20
A, 30
B, 20
B, 5
B, 25
C, 10
C, 12
C, 22
];
NoConcatenate
Final:
Load
COLUMN1,
COLUMN2,
IF(COLUMN1 = PEEK('COLUMN1'), RangeSum(Peek('COLUMN3'),COLUMN2), COLUMN2) as COLUMN3
Resident Temp
Order By COLUMN1;
Drop Table Temp;
Create a straight table
Dimension =
Column1
Column2
Expression
RangeSum(Above(SUM(COLUMN2),0,RowNo()))
UPDATE : You can do the same at script level
Temp:
Load * Inline
[
COLUMN1, COLUMN2
A, 10
A, 20
A, 30
B, 20
B, 5
B, 25
C, 10
C, 12
C, 22
];
NoConcatenate
Final:
Load
COLUMN1,
COLUMN2,
IF(COLUMN1 = PEEK('COLUMN1'), RangeSum(Peek('COLUMN3'),COLUMN2), COLUMN2) as COLUMN3
Resident Temp
Order By COLUMN1;
Drop Table Temp;
Can you please write the script in details?Best write a part of critical scripts thanks
Thank you very much for your help~