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