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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
suraj_qlik
Contributor II
Contributor II

Removing duplicates

Hello Guys,

Can you help to remove the duplicates from a chart which would look something like this:(sample data)

KPI_1KPI_2Correlation
AB.5
BA.5
AD.6
CD.5
DA0.6

 It should look like the following:

KPI_1KPI_2Correlation
AB.5
AD.6
CD.5

so since correlation of A and B is same as B & A, hence I want those to removed.

Please help.

 

 

Labels (2)
1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

tmp:
LOAD  In, RecId, Concat(Char) as Out,KPI_1,	KPI_2,	Correlation
GROUP BY In, RecId,KPI_1,	KPI_2,	Correlation;
LOAD *, Recno() as RecId,
  Mid(In,Iterno(),1) as Char
WHILE iterno() <= Len(In);
Load *, KPI_1&KPI_2&Correlation as In;
Load * Inline [
KPI_1,	KPI_2,	Correlation
A,	B,	0.5
B,	A,	0.5
A,	D,	0.6
C,	D,	0.5
D,	A,	0.6
];

NoConcatenate
final:
load *, if(Out=peek(Out,-1),Null(),Out) as test Resident tmp 
Where if(Out=peek(Out,-1),Null(),Out)<>Null() Order by Out; DROP Table tmp;

View solution in original post

3 Replies
Anil_Babu_Samineni
MVP
MVP

Does it mean, If KPI1 or KPI2 having similar values it should not point to duplicate value or Correlation?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
suraj_qlik
Contributor II
Contributor II
Author

Yes, correct @Anil_Babu_Samineni . We should be able to see just correlation of A & B and not B & A (as it will be same)

Frank_Hartmann
Master II
Master II

tmp:
LOAD  In, RecId, Concat(Char) as Out,KPI_1,	KPI_2,	Correlation
GROUP BY In, RecId,KPI_1,	KPI_2,	Correlation;
LOAD *, Recno() as RecId,
  Mid(In,Iterno(),1) as Char
WHILE iterno() <= Len(In);
Load *, KPI_1&KPI_2&Correlation as In;
Load * Inline [
KPI_1,	KPI_2,	Correlation
A,	B,	0.5
B,	A,	0.5
A,	D,	0.6
C,	D,	0.5
D,	A,	0.6
];

NoConcatenate
final:
load *, if(Out=peek(Out,-1),Null(),Out) as test Resident tmp 
Where if(Out=peek(Out,-1),Null(),Out)<>Null() Order by Out; DROP Table tmp;