Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Reverse Duplicates II Expressions

How do we remove reverse duplicates in Qlikview?

I have a table that contains rows like AB,AC,AD and BA,BC,BD.

COL 1COL2
AB
AC
AD
BA
CA
DA

The following is a description and solution for the problem in SQL. I am just not able to figure out how to do this in QlikView?

http://stackoverflow.com/questions/13041802/remove-reverse-duplicates-from-an-sql-query

The problem has already been solved using scripting. Reverse Duplicates

My Question is, could we achieve the same using QlikView chart expressions?

Regards,

Gokul

1 Reply
MVP & Luminary
MVP & Luminary

Re: Reverse Duplicates II Expressions

Hi Gokul,

Handling this in set analysis is very difficult what I can suggest is arrive a flag in script and then use set analysis to exclude the duplicates, try like below

Temp:

LOAD *,Ord(Pos1) + Ord(Pos2) as Value;

LOAD * Inline [

Pos1,Pos2

A,B

A,C

A,D

B,A

C,A

D,A

];

Data:

LOAD

*,

If(Peek(Value) <> Value, 0, 1) AS IsDuplicate

RESIDENT Temp

ORDER BY Value;

DROP TABLE Temp;

Now in chart try below expressions

Count({<IsDuplicate={0}>} POS1)

Hope this helps you.

Regards,

Jagan.