KX Community

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

Home Forums KX Academy KX Fundamentals Capstone Re: KX Fundamentals Capstone

  • leahs

    Member
    November 29, 2021 at 12:00 am

    Hello,

    Thanks for sharing this with the community. Great content!

    I believe the error generated is a result of your method for retrieving the unique OptionIDs. Given your table is partitioned, this method of taking columns from tables will not work . Hence the ‘unable to operate on a partitioned table’ error.

    I suggest querying the table, meaning avail of Functional qSQL Statements as an alternate approach to obtain the unique OptionIDs from the trade table.

    Functional qSQL information can be studied here: https://code.kx.com/q/basics/funsql/

    Specifically focus your attention on the functional form ‘exec’  https://code.kx.com/q/ref/exec/

    In summary, rather than

     

    uniqueOpts:distinct trade`option_id
    
    

    Create uniqueOpts by following the syntax below (provided in the previous link) where square brackets mark optional elements. This is what we refer to as ‘querying’ the table.

     

    exec [distinct] ps [by pb] from texp [where pw]

     

    The above code is a ‘hint’ and requires modification.

    Hope this helps.

    Kind regards,

    Leah