Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
This is my script.
[one]:
LOAD * INLINE [
list, amt, key
1, 2, 1-2
1, 4, 1-2
2,3, 2-3
];
NoConcatenate
[two]:
load Distinct key, list, amt
Resident one;
drop Table one;
I was expecting the duplicate keys to drop in table two but they did not.
what am I missing here?
try this:
tmp:
LOAD * INLINE [
list, amt, key
1, 2, 1-2
1, 4, 1-2
2,3, 2-3
];
NoConcatenate
DISTINCT:
LOAD distinct key,
list,
amt
Resident tmp;
Final_DISTINCT:
NoConcatenate
LOAD *
Resident DISTINCT
Where key <> Previous(key)
Order By key;
DROP Tables DISTINCT,tmp;
try this:
tmp:
LOAD * INLINE [
list, amt, key
1, 2, 1-2
1, 4, 1-2
2,3, 2-3
];
NoConcatenate
DISTINCT:
LOAD distinct key,
list,
amt
Resident tmp;
Final_DISTINCT:
NoConcatenate
LOAD *
Resident DISTINCT
Where key <> Previous(key)
Order By key;
DROP Tables DISTINCT,tmp;
Distinct applies to an entire line, not to a single field. Since your lines are not duplicates due to a different amt value, they won't be removed by the DISTINCT.
Which of the two lines would you expect to be kept in this scenario? Or should the line be 1, 6, 1-2 because of sum(amt)?