Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have data like shown below:
mop | order |
3/1/2012 | 10 |
4/1/2012 | 35 |
5/1/2012 | 63 |
6/1/2012 | 80 |
7/1/2012 | 120 |
8/1/2012 | 200 |
9/1/2012 | 390 |
10/1/2012 | 638 |
11/1/2012 | 1250 |
12/1/2012 | 2599 |
1/1/2013 | 3200 |
2/1/2013 | 4320 |
3/1/2013 | 7980 |
But i want change like below in my load script:
mop | withinmonth | 1month | 2month | 3month | 4month | 5month | 6month | >6 and <=12month |
3/1/2012 | 10 | 35 | 63 | 80 | 120 | 200 | 390 | 19987 |
4/1/2012 | 35 | 63 | 80 | 120 | 200 | 390 | 638 | 19349 |
5/1/2012 | 63 | 80 | 120 | 200 | 390 | 638 | 1250 | 18099 |
6/1/2012 | 80 | 120 | 200 | 390 | 638 | 1250 | 2599 | 15500 |
7/1/2012 | 120 | 200 | 390 | 638 | 1250 | 2599 | 3200 | 12300 |
8/1/2012 | 200 | 390 | 638 | 1250 | 2599 | 3200 | 4320 | 7980 |
9/1/2012 | 390 | 638 | 1250 | 2599 | 3200 | 4320 | 7980 | 0 |
10/1/2012 | 638 | 1250 | 2599 | 3200 | 4320 | 7980 | 0 | 0 |
11/1/2012 | 1250 | 2599 | 3200 | 4320 | 7980 | 0 | 0 | 0 |
12/1/2012 | 2599 | 3200 | 4320 | 7980 | 0 | 0 | 0 | 0 |
1/1/2013 | 3200 | 4320 | 7980 | 0 | 0 | 0 | 0 | 0 |
2/1/2013 | 4320 | 7980 | 0 | 0 | 0 | 0 | 0 | 0 |
3/1/2013 | 7980 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Could you please advise me
Best,
Robert
Hi Sergey,
As per your logic I can't use the below:
LOAD*,
IF(isNull(Peek('sum')),0,Previous(Month6)+Peek('sum')) AS [sum];
I have added some more date in my source data
mop | order |
3/1/2012 | 10 |
4/1/2012 | 35 |
5/1/2012 | 63 |
6/1/2012 | 80 |
7/1/2012 | 120 |
8/1/2012 | 200 |
9/1/2012 | 390 |
10/1/2012 | 638 |
11/1/2012 | 1250 |
12/1/2012 | 599 |
1/1/2013 | 3200 |
2/1/2013 | 4320 |
3/1/2013 | 7980 |
4/1/2013 | 3200 |
5/1/2013 | 4320 |
6/1/2013 | 7980 |
3/1/2012 - [sum] would be colored data but if i apply your logic its sum of all data after 9/1/2012.
As I told you that i want some (Month 7 to Month 12) for [sum] for each mop and if i don't have Month 7 to Month 12 for some mop, its doesn't matter just make zero.
My source data will be automatically updated when the month passes.
hope you understand my logic.
Please advise me.
Best,
Robert
Yes, I agree, My fault.
Do you need it in Load Script? or can you make your calculations in the chart?
It's faster to do in the chart.
Just use expression RangeSum(Above (Sum(Month6),-1,6))
PFA
Many Thanks