Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
how to eliminate the duplicate rows in qlikvew
id | name |
---|---|
1 | a |
1 | a |
2 | b |
2 | c |
3 | d |
i want to o/p like this
1 a
2 b
3 d
eliminates the duplicates in id.
TABLE:
LOAD DISTINCT
id,
name
FROM .... ;
Hi,
Try like this
LOAD
DISTINCT
id, name
FROM TableName;
Regards,
Jagan.
use distinct keyword
distinct ID, name
Hi harish,
Since you have two different name for ID=2, you will get two entries for ID=2.
Regards
KC
Hi Jagan,
I tired following but when i load no field is coming. Can you tell me what is the issue?
tab1:
LOAD * INLINE [
ID, Name
1, a
1, a
2, b
2, c
3, d
];
tab2:
load distinct
ID,
Name
resident tab1;
drop table tab1;
Regards
KC
Hi,
Use Distinct keyword in Load statement
Regards,
khalander
Hello,
I doubt if the distinct keyword will work here. 2,b and 2,c are not duplicate rows (Yes the ID is duplicate) but rows are not so qlikview will treat them as separate rows.
Thanks
Amit
Hi Jyothish,
You are getting no data because two tables are auto concatenated and then you are dropping the tab1.
You should try something like this
Test:
load * inline
[
id,name
1,a
1,a
2,b
2,c
3,d
];
Test1:
load Distinct id,name,1 as RecordCounter Resident Test;
drop Table Test;
Thanks
Amit
Hi, you can use exists to check if a id is previously loaded
LOAD
id, name
FROM TableName where no exists('id', id);
This will load the first id and name found.