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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
chagantiapps
Contributor
Contributor

Complex and challenging task for Qlik developers

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
       
Labels (4)
3 Replies
Pierrick
Partner - Contributor III
Partner - Contributor III

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];
chagantiapps
Contributor
Contributor
Author

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
Pierrick
Partner - Contributor III
Partner - Contributor III

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;