Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
mario-sarkis
Creator II
Creator II

Compare two Raws

Dears,

I need solve the below by Script :

   

In Put
IDDateDPDMonthYear_Month
110/4/201711110201710
110/14/201712110201710
Out Put
IDDateDPDDPD2MonthYear_Month
110/4/201711112110201710
110/14/2017121-10201710

The Output above is for each Month

Hope that you can help,

Thank you

4 Replies
vvira1316
Specialist II
Specialist II

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

mario-sarkis
Creator II
Creator II
Author

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

Anil_Babu_Samineni

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;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vvira1316
Specialist II
Specialist II

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;PrevData.JPG