KX Community

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

Home Forums kdb+ Referencing new column Re: Referencing new column

  • cillianreilly

    Member
    November 16, 2021 at 12:00 am

    As David mentioned, you can’t reference iq2 before you create it. If your where clause isn’t too wieldy, you can just include that in the qsql query to create column iq2:

    q)select name,iq2:iq%100 from t where 1<iq%100 
    name    iq2 
    ------------ 
    Prefect 1.26

    This does the calculation twice, so be careful with particularly heavy where conditions.