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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

getting first hit on unqiue id in table

i have these lines in an excel:

id, value, status, country

1, 100, CER, NL

1, 200, CEP, NL

1, 500, CQW, NL

2, 400, FEE, BE

3, 500, ERT, CZ

3, 600, RTP, CZ

3, 200, RTP, CZ

what i want is from each unique id .. the first hit..

so.. this will give me 3 records. I think i first have to load the complete table .. and the do a RESIDENT load with peek. or thinking about a rowno/previous solution. any suggestions?

1 Solution

Accepted Solutions
disqr_rm
Partner - Specialist III
Partner - Specialist III

Here you go:


Tab:
LOAD * INLINE [
id, value, status, country
1, 100, CER, NL
1, 200, CEP, NL
1, 500, CQW, NL
2, 400, FEE, BE
3, 500, ERT, CZ
3, 600, RTP, CZ
3, 200, RTP, CZ
];
NewTab:
LOAD id as new_id,
value, status, country
RESIDENT Tab
where id <> peek('new_id');
drop table Tab;


View solution in original post

3 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

Here you go:


Tab:
LOAD * INLINE [
id, value, status, country
1, 100, CER, NL
1, 200, CEP, NL
1, 500, CQW, NL
2, 400, FEE, BE
3, 500, ERT, CZ
3, 600, RTP, CZ
3, 200, RTP, CZ
];
NewTab:
LOAD id as new_id,
value, status, country
RESIDENT Tab
where id <> peek('new_id');
drop table Tab;


amien
Specialist
Specialist
Author

Thanks for your reply .. this cant be done in the initial load right? i need the second table and drop the first

disqr_rm
Partner - Specialist III
Partner - Specialist III

This is correct Amien.