Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
chinnuchinni
Contributor III

Load Distinct Values

Hi Every one,

I have 3 fields in a table A,B,C.

i need to load distinct of A values and also i  need  3 fields.

if i keep

load distinct A, B, C  from xyz;

it is giving only the distinct rows.

please help me on this.

Regards

Praveen

7 Replies
Highlighted
Partner
Partner

Re: Laod Distinct values

Can you share sample data and expected output.

If you need Only Distinct A but with other 2 Fields. What will be the criteria to filter other 2 columns?

Because if load Distinct A and Left join B and C to A then again it will duplicate values from A.

Highlighted
chinnuchinni
Contributor III

Re: Laod Distinct values

Actually in A we have data 1,2,3,4,5,6.........some fields are repeated

In B we have data 1,2,3,.........which are repeated

In C we have date  which are associate dates which are repeated.

now i want the out put : distinct A values ,min(C) dates,associate B values

Highlighted
Partner
Partner

Re: Laod Distinct values

then you can try

Load A,B, Min(C) as C

From XYZ

Group by A,B;

Highlighted
chinnuchinni
Contributor III

Re: Laod Distinct values

i tried but with that am not getting distinct A values. some values are repeating

Highlighted
Partner
Partner

Re: Laod Distinct values

you can try  (not so sure about it)

Table1:

Load A &'-'& Min(C) as Key,

A,Min(C) as C

From XYZ

Group by A;

Left Join (Table1)

Load A &'-'& C as Key,

B

From XYZ;

Highlighted
antoniotiman
Honored Contributor III

Re: Laod Distinct values

Try this

LOAD A,FirstSortedValue(DISTINCT B,C) as B,Min(C) as C

From ...

Group By A;

Highlighted
kiko1955
New Contributor

Re: Laod Distinct values

Datos:
Load * inline [
A,B,C
1,2,3
1,3,4
2,4,5
2,4,5
3,1,2
4,3,1
4,5,6
5,2,3
]
;
NoConcatenate
SinRepetir:
Load
A as AA,
B as BB,
C as CC
Resident Datos
Where Previous(A) <> A
Order by A