KX Community

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

Home Forums kdb+ select with assignment Reply To: select with assignment

  • gregbowers

    Member
    March 14, 2024 at 7:42 am

    Hello powerpeanuts,

    In q, the select statement operates in a manner that doesn’t allow for the assignment of temporary variables within the select statement itself. Therefore, the behavior you’re describing, where you can assign a temporary variable during select and reuse it within the same column, isn’t supported.

    The select statement in q typically operates on columns of a table or on the result of an expression, but it doesn’t support intermediate assignment of variables like in some other programming languages.

    To achieve the desired result, you may need to break down the calculation into separate steps or use functions to manipulate the data in the way you intend.

    Thanks for sharing https://learninghub.kx.com/forums/topic/select-with-assignment/salesforce cpq

    Thank you

    Stevediaz