Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
mikaelbe
New Contributor

How to distinct load a table on multiple fields

Hi,

I have a table (lets call it TableA) that looks like this:

ColA     ColB     ColC

Red         1             A

Red         1             A

Red         1             A

Blue         2            B

Blue         2            B

Black       3            C

Black       3            D

Black       1            D

What I want to do is to get rid of duplicated rows, so to say I want to load this table or convert it into a new table distinct on all three columns so the result ends up like this:

ColA     ColB     ColC

Red         1             A

Blue         2            B

Black       3            C

Black       3            D

Black       1            D

How do I do this?

BR

1 Solution

Accepted Solutions

Re: How to distinct load a table on multiple fields

LOAD

Distinct * inline
[

ColA ,    ColB,     ColC

Red     ,    1    ,        A

Red    ,     1     ,        A

Red   ,      1     ,        A

Blue  ,       2     ,       B

Blue ,        2     ,       B

Black   ,    3     ,       C

Black  ,     3     ,       D

Black   ,    1    ,        D

]
;

Use "DISTINCT" Keyword

2 Replies
shree909
Valued Contributor II

Re: How to distinct load a table on multiple fields

try this

load

distinct(ColA )

distinct(   ColB   )

distinct(  ColC)

from table ...

Re: How to distinct load a table on multiple fields

LOAD

Distinct * inline
[

ColA ,    ColB,     ColC

Red     ,    1    ,        A

Red    ,     1     ,        A

Red   ,      1     ,        A

Blue  ,       2     ,       B

Blue ,        2     ,       B

Black   ,    3     ,       C

Black  ,     3     ,       D

Black   ,    1    ,        D

]
;

Use "DISTINCT" Keyword

Community Browser