KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ abs() vs abs[] for fby

  • abs() vs abs[] for fby

    Posted by kdb_newbie on May 17, 2024 at 2:49 am

    May I ask how does abs() differs from abs[] in a select statement using fby clause? Thank you!

    q)tab:([] sym:g1g3g1g1g2g3; price:-2.5 2 -0.5 -0.2 3 4)

    q)tab

    sym price

    ---------

    g1 -2.5

    g3 2

    g1 -0.5

    g1 -0.2

    g2 3

    g3 4

    q)select from tab where abs(price)=({abs max x};price) fby sym

    'type

    [0] select from tab where abs(price)=({abs max x};price) fby sym

    ^

    q)

    replied 11 months, 4 weeks ago 0 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

Log in to reply.