Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Expert,
Need help for EQUNR_S to get Act_Typ difference for same field Doc-Date.
How to calculate the same in chart or while loading.
ID | Ship_Key | Doc_Date | EQUNR_S | Act_Typ | get date difference |
1 | 0000000001000101397Z20 | 01.02.2011 | 1397 | ER | 0 |
13 | 0000000002000101397Z30 | 01.02.2011 | 1397 | E | 0.00 |
10076 | 0000001797000201397Z30 | 10.06.2011 | 1397 | F | 129.00 |
10078 | 0000001798000201397Z30 | 13.06.2011 | 1397 | D | 3.00 |
10080 | 0000001799000201397Z20 | 13.06.2011 | 1397 | T | 0.00 |
11256 | 0000002262000101397Z20 | 16.07.2011 | 1397 | ER | 33.00 |
13189 | 0000003284000101397Z30 | 29.10.2011 | 1397 | I | 105.00 |
Thanks
Ashif
HI,
Try like this
Temp:
LOAD *, if(previous(EQUNR_S=EQUNR_S, Doc_Date - previous(Doc_Date),0) as TT,
if(previous(EQUNR_S<>EQUNR_S, 1, 0) AS Flag,
if(previous(EQUNR_S=EQUNR_S, RangeSum(Peek([TT]), Doc_Date - previous(Doc_Date)), (Doc_Date - previous(Doc_Date)) AS AccumSum
Resident Temp
Order By EQUNR_S, Doc_Date;
Result:
NoConcatenate
LOAD *,
if(previous(EQUNR_S<>EQUNR_S, 1, 0) AS Flag
Resident Temp
Order By EQUNR_S, Doc_Date DESC;
Now in front end
Chart : Straight Table
Dimension: EQUNR, Act_Typ
Expression: Sum({<Flag ={1}>}AccumSum)
REgards,
Jagan.