Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dears,
I need solve the below by Script :
| In Put | |||||
| ID | Date | DPD | Month | Year_Month | |
| 1 | 10/4/2017 | 111 | 10 | 201710 | |
| 1 | 10/14/2017 | 121 | 10 | 201710 | |
| Out Put | |||||
| ID | Date | DPD | DPD2 | Month | Year_Month |
| 1 | 10/4/2017 | 111 | 121 | 10 | 201710 |
| 1 | 10/14/2017 | 121 | - | 10 | 201710 |
The Output above is for each Month
Hope that you can help,
Thank you
HI,
If you arrange/read your data in descending order and use previous() script function then you may be able to do it.
BR,
Vijay
Hi Vijay Thank you for you response,
I am really sorry I didn't understand what you meant , could you please give me a sample example ?
thank you
Perhaps this?
Sam:
LOAD * Inline [
ID, Date, DPD, Month, Year_Month
1, 10/4/2017, 111, 10, 201710
1, 10/14/2017, 121, 10, 201710
];
NoConcatenate
LOAD *, Previous(DPD) as DPD2 Resident Sam Order By DPD desc;
DROP Table Sam;
NoConcatenate
DataTmp:
LOAD ID,
Date,
DPD,
Month,
Year_Month
FROM
PrevData.xlsx
(ooxml, embedded labels, table is Sheet1);
NoConcatenate
DataReorder:
LOAD ID,
Date,
DPD,
Month,
Year_Month,
Previous(DPD) as PrevDPD
Resident DataTmp
Order by ID, Date desc;
DROP Table DataTmp;