Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Mitch_Data
Contributor III
Contributor III

Find latest row for each "Kenteken" and only import those

Hi there.

 

I have a problem and I can't seem to fix it in my load editor I want to import only the values of the latest row found for each Kenteken. So for instance a Kenteken xx-00-xx can be on row 12000 and the same one xx-00-xx can be on 14000. I only want to import the latest row with that particular kenteken and other fields in order to get rid off duplicates. I want it to be done in the load editor and not in the front-end.

 

Unfortunately I can't do anything with dates because they can be similar and there are too many variances.

 

This is the script:

feit_Boekwaardelijst:
Load DISTINCT
     Kenteken,
    "Boekwaarde bedrag",
    "Boekwaarde datum",
"Boekwaarde bedrag BTW",
"Restwaarde bedrag",
    "Restwaarde datum",
"Afschrijving termijnen",
"Afschrijving KM",
  "Afschrijving schade",
"Afschrijving kosten",
"Afschrijving corr. rente",
Verkoopbedrag,
"Kostprijs verkoop",
"Verkoop resultaat",
Investering,
  "Verkoopprijs incl. BTW",
  Capitalize("Debiteur verkoop") as  "Debiteur verkoop",
  '-' & "Debiteur verkoop" as Handelaren,
    "Verkoop soort",
  Num("Inname stand", '#.##0') as "Inname stand"
FROM [lib://IC Files - Company/Stream - ML - Algemeen/App - Verkooprapportage/Boekwaardelijst 2018 - 2023.xlsx]
(ooxml, embedded labels, table is Tabelle1;
 
 
 
 
Thanks a lot.

 

Labels (1)
3 Replies
BrunPierre
Partner - Master
Partner - Master

Hi, could you share a few lines of the dataset.

Mitch_Data
Contributor III
Contributor III
Author

Sure thing. This is an example how it may look. Unfortunately date can't be used since sometimes the date can be the same for 4 instances for example. In this case I want to take row number 3 and not import number 2, because the a higher row number means that it is being imported later. 

Of course the dataset consists of multiple 100.000 rows.

BrunPierre
Partner - Master
Partner - Master

Try

Data:
LOAD AutoNumber(Recno(),Kenteken) as %Key
*
FROM Source;

Inner Join
LOAD Max(%Key) as %Key
Resident Data;