Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
Please take a look below script, It's working fine for Max Value..
A:
LOAD * INLINE [
ID, Value, Cat
1, 32, A
1, 89, B
1, 45,C
2, 31,A1
2, 32,A2
3, 59,B1
4, 30,C1
4, -39,C2
5, 21,D1
5, 34,D2
5, 46,D3
6, -,D4
];
LOAD ID, Max(Values) as MaxValue Resident A
Group By ID;
OutPut showing below like, It's repeating the value - my scenario It should not be repeat the value !
Thanks In Advance!
Try this.
A:
LOAD * INLINE [
ID, Value, Cat
1, 32, A
1, 89, B
1, 45,C
2, 31,A1
2, 32,A2
3, 59,B1
4, 30,C1
4, -39,C2
5, 21,D1
5, 34,D2
5, 46,D3
6, -,D4
];
Temp:
LOAD ID&Max(Value) as Key Resident A
Group By ID;
B:
Load *,If(Exists(Key,ID&Value),1,0) as MaxFlag Resident A;
Drop table A,Temp;
Try this.
A:
LOAD * INLINE [
ID, Value, Cat
1, 32, A
1, 89, B
1, 45,C
2, 31,A1
2, 32,A2
3, 59,B1
4, 30,C1
4, -39,C2
5, 21,D1
5, 34,D2
5, 46,D3
6, -,D4
];
Temp:
LOAD ID&Max(Value) as Key Resident A
Group By ID;
B:
Load *,If(Exists(Key,ID&Value),1,0) as MaxFlag Resident A;
Drop table A,Temp;
Awesome Kaushik 🙂
That's great.