Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik Experts,
i have challenging task, hope you will provide the solution for following
i have a car repair data like below
example car no 121 has three repairs , but if the Repair description is same and if repair dates with in 5 days ,i have to show only latest repair record , can any one help on this in Qlikview or Qliksense
added input and desired output
input data
car no | Repair description | Repair Date | Rule No |
121 | Wheel change | 31-01-2023 | 3 |
121 | back tyre change | 21-02-2023 | 5 |
131 | regular checkup | 12-05-2023 | 4 |
121 | Wheel change | 28-01-2023 | 3 |
131 | regular checkup | 16-05-2023 | 4 |
desired output | |||
car no | Repair decription | Repair Date | Rule No |
121 | Wheel change | 31-01-2023 | 3 |
121 | back tyre change | 21-02-2023 | 5 |
131 | regular checkup | 16-05-2023 | 4 |
Hi @chagantiapps,
you can do :
//KEY : [car no]&[Rule No] as KEY
Load
*
Resident DATA
where [KEY]<>Peek([KEY]) or ([Repair Date]-Peek([Repair Date])>5)
order by KEY, [Repair Date];
thanks for answer but its not showing latest repair dates
car no | Repair decription | KEY | Repair Date | Rule No |
121 | Wheel change | 1213 | 28/01/2023 | 3 |
121 | back tyre change | 1215 | 21/02/2023 | 5 |
131 | regular checkup | 1314 | 12/05/2023 | 4 |
Oh sorry, add desc in the order by :
Load
*
Resident DATA
where [KEY]<>Peek([KEY]) or ([Repair Date]-Peek([Repair Date])>5)
order by KEY, [Repair Date] desc;