Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a table showing results of inspections on equipment. The table has all the historical inspections data but I want to only load the latest inspections based on the latest inspection date.
How can I do this in the load script?
Example AS-IS data below:
Equipment_Number | Inspection_Date | Inspection_Status |
1 | 01/01/2020 | Pass |
1 |
03/06/2022 |
Pass |
1 | 08/03/2023 | Pass |
2 | 05/05/2019 | Fail |
2 | 08/12/2021 | Pass |
3 | 18/10/2019 | Fail |
3 | 23/03/2022 | Fail |
How I want it to load:
Equipment_Number | Inspection_Date | Inspection_Status |
1 | 08/03/2023 | Pass |
2 | 08/12/2021 | Pass |
3 | 23/03/2022 | Fail |
Thanks
Hi, a solution could be this.
Data:
LOAD Equipment_Number,
Inspection_Date,
Inspection_Status
FROM SourceTable;
Inner Join(Data)
LOAD Equipment_Number,
Max(Inspection_Date) as Inspection_Date
Resident Data
Group By Equipment_Number;
Hi, a solution could be this.
Data:
LOAD Equipment_Number,
Inspection_Date,
Inspection_Status
FROM SourceTable;
Inner Join(Data)
LOAD Equipment_Number,
Max(Inspection_Date) as Inspection_Date
Resident Data
Group By Equipment_Number;
Thank you!