Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to find previous repair details withing the table

I have list of SN (serial numbers) and RMA (repairs) with CLOSED DATE and REPAIR REASON. I need to program script this way that in column LAST RMA, LAST CLOSED DATE and LAST REASON, it will show me the details of last repair (RMA) for this serial number (SN), for example for SN 2 and RMA C the LAST RMA would be B with LAST CLOSED DATE 7-Feb and LAST REASON R17.

I have no idea how to do it.

RMASNCLOSED_DATEREPAIR_REASONLAST RMALAST CLOSED DATELAST REASON
A15-FebR13
F13-MarR10F5-FebR13
F13-MarR10F5-FebR13
F13-MarR10F5-FebR13
B27-FebR17
B27-FebR17
C220-FebR19B7-FebR17
D21-MarR16C1-MarR16
G23-MarR14D1-MarR16
G23-MarR14D1-MarR16
E32-MarR20
4 Replies
Not applicable
Author

Hi,

Use the peek function. Find the syntax below:

Peek('Columnname',Rowno,'TableName')

Find the attached file for reference.

Arun

Not applicable
Author

it will work just the loaded table is sorted already by SN and CLOSED date but it won't work if it's not sorted

SNRMACLOSED_DATEREPAIR_REASON
2D1-MarR16
3E2-MarR20
1F3-MarR10
1F3-MarR10
2G3-MarR14
2G3-MarR14
1A5-FebR13
2B7-FebR17
2B7-FebR17
2C20-FebR19
Not applicable
Author

in Script Sort it




Order By CLOSED_DATE desc

Not applicable
Author

Try this.

We have order the tables before using the peek.

Arun