Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two fields id and Product for example
id product
1 a
2 b
3 a
3 b
4 a
4 b
I should get
1 a
2 b
3 a
4 a
id should be uniqe and product should be lowest
Please help me
You can do it by using FirstValue and Group By clause
Sample:
Load * inline [
id ,product
1 ,a
2 ,b
3 ,a
3 ,b
4 ,a
4 , b];
DistinctProductList:
Load id, FirstValue(product) As DistinctProduct
Resident
Sample
Group By id;
Drop Table Sample;
Hope this helps
You can do it by using FirstValue and Group By clause
Sample:
Load * inline [
id ,product
1 ,a
2 ,b
3 ,a
3 ,b
4 ,a
4 , b];
DistinctProductList:
Load id, FirstValue(product) As DistinctProduct
Resident
Sample
Group By id;
Drop Table Sample;
Hope this helps
HI
Please find attachment.