Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have sample data like
I'd, product, sales
1, a, 10
2, b, 20
3, c, 30
4, d, 40
My required output
I'd, product, sales, accumulate
1, a, 10, 10
2, b, 20, 30
3, c, 30, 50
4, d, 40 ,70
How to write the expression in script level and chat level also.
Please help.
Thanks
Hi,
Try the following code:
Table1:
LOAD
if(isnull(Peek(sales)),sales,Peek(sales) + sales) AS accumulate,
* INLINE [
I'd, product, sales
1, a, 10
2, b, 20
3, c, 30
4, d, 40
];
Hi,
Try the following code:
Table1:
LOAD
if(isnull(Peek(sales)),sales,Peek(sales) + sales) AS accumulate,
* INLINE [
I'd, product, sales
1, a, 10
2, b, 20
3, c, 30
4, d, 40
];
Hi,
Please find attached the Qvw and solution script.
LOAD *, Sales + if(recno()=1,0,Previous(Sales)) as Salesf ;
LOAD * inline [
I'd, product, Sales
1, a, 10
2, b, 20
3, c, 30
4, d, 40
];
if you found this helpful, please mark helpful or correct.
Regards,
Bhasker Kumar
Hi Bhasker both are working fine.
Do you know how to write the expression using range sum function .