Whats the best way to do this
I have a table
sym val
`GE 5
`GE 10
`GE -20
`MSFT 7
`MSFT -3
I want to get the max abs value by sym but keep the sign
sym val maxabs
`GE 5 -20
`GE 10 -20
`GE -20 -20
`MSFT 7 7
`MSFT -3 7
Whats the best way to do this
I have a table
sym val
`GE 5
`GE 10
`GE -20
`MSFT 7
`MSFT -3
I want to get the max abs value by sym but keep the sign
sym val maxabs
`GE 5 -20
`GE 10 -20
`GE -20 -20
`MSFT 7 7
`MSFT -3 7
Could use first/last along with idesc:
q)update maxabs:val@first idesc abs val by sym from t
a 5 -20
a 10 -20
a -20 -20
b 7 7
b -3 7
q)update maxabs:val@last idesc abs val by sym from t
a 5 5
a 10 5
a -20 5
b 7 -3
b -3 -3
Terry
Thanks Terry