Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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
then you can try
Load A,B, Min(C) as C
From XYZ
Group by A,B;
i tried but with that am not getting distinct A values. some values are repeating
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;
Try this
LOAD A,FirstSortedValue(DISTINCT B,C) as B,Min(C) as C
From ...
Group By A;
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