KX Community

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

Home Forums kdb+ select with assignment Re: select with assignment

  • rocuinneagain

    Member
    September 15, 2022 at 12:00 am

    You cannot do inline temporary variable creation as @eohara pointed out.

     

    Instead you can use a lambda to avoid performing the calculation twice:

    q)select {[a;b] (total+5)%(total:a+b)}[a;b] from t 
    b 
    -------- 
    2 
    1.714286 
    1.555556