Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
see attached image ,
I did to calculation like this : Quantity+Alt(Peek(Q2),0) As Q2
I did from calculation like this : if(isnull(Previous(Q2)),0,Previous(Q2)) As Q1
by doing resident .
what I want is accumulate year wise ..ie from , to is accumulated totally
but i want it for each year accumulation..
here in 2014 start , from should be 0 and to should be 5 in this case.
Thanks in advance ,
Deepak Sibi
Can you post your script
Hi anbu,
here is my script
LOAD *,
Quantity+Alt(Peek(Q2),0) As Q2;
target2:
LOAD * INLINE [
TargetDate,product,Quantity
12-01-2013, A, 6
19-04-2013, A, 7
06-08-2013, A, 10
11-11-2013, A, 13
15-02-2014, A, 5
11-05-2014, A, 6
26-07-2014, A, 4
16-12-2014, A, 2
];
target1:
LOAD Year(TargetDate) as New_Year,TargetDate, Only(product) as product,sum(Quantity) as Quantity,max(if(isnull(Previous(Q2)),0,Previous(Q2))) as from,Only(Q2) as to Resident target2 Group by Year(TargetDate),TargetDate;
DROP Table target2;
help needed !!
LOAD *,Year(TargetDate) as New_Year,
Quantity+Alt(Peek(Q2),0) As Q2;
target2:
LOAD Date#(TargetDate,'D-M-YYYY') As TargetDate,product,Quantity INLINE [
TargetDate,product,Quantity
12-01-2013, A, 6
19-04-2013, A, 7
06-08-2013, A, 10
11-11-2013, A, 13
15-02-2014, A, 5
11-05-2014, A, 6
26-07-2014, A, 4
16-12-2014, A, 2
];
target1:
LOAD New_Year,TargetDate, Only(product) as product,sum(Quantity) as Quantity,max(if(New_Year <> Previous(New_Year),0,(if(isnull(Previous(Q2)),0,Previous(Q2))))) as from,Only(Q2) as to Resident target2 Group by TargetDate,New_Year
Order by New_Year;
DROP Table target2;
Thanks anbu ,
but already i have also done it ..and finished it.