Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
To avoid having to use above() excessively in my formulas I tried to accumulate my numbers in the load command. As the previous() however is always looking into the source table the following code does not work
Normal:
LOAD * INLINE [
dim, mycount
1, 3
1, 1
1, 4
2, 7
2, 18
2, 1
];
Accumulated:
LOAD dim
, if(previous(dim)=dim,previous(mycume)+mycount,mycount) as mycume
RESIDENT Normal;
and the following is only the sum of the current and above row
Accumulated:
LOAD dim
, if(previous(dim)=dim,previous(mycount)+mycount,mycount) as mycume
RESIDENT Normal;
Juerg
HI,
I`m not sure i have understood your question.
can elaborate a bit. since i have tried to reproduce your scenario. it worked as i expected.
Below is my code
Accu:
LOAD
* INLINE[
;
Noconcatenate
Accu_Temp:
Load
* Resident Accu order by dimAsc;
Drop
TableAccu;
Load
dim, if(peek(dim) = dim, peek(mycount_new)+mycount,mycount) as mycount_new,mycountResident
Accu_Temp;
Drop
TableAccu_Temp;
HI,
I`m not sure i have understood your question.
can elaborate a bit. since i have tried to reproduce your scenario. it worked as i expected.
Below is my code
Accu:
LOAD
* INLINE[
;
Noconcatenate
Accu_Temp:
Load
* Resident Accu order by dimAsc;
Drop
TableAccu;
Load
dim, if(peek(dim) = dim, peek(mycount_new)+mycount,mycount) as mycount_new,mycountResident
Accu_Temp;
Drop
TableAccu_Temp;