Allow user to choose kdb+ pivots from UI? - Pulse

Home Forums Pulse Allow user to choose kdb+ pivots from UI?

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #111733

    quantific
    Participant

    Hi,
    I want to allow the user to dynamically choose the columns to pivot by in Pulse?
    Is this possible?
    Thanks.
    q)

    #111734

    admin
    Keymaster

    Hi Quantific,

    Let’s assume you have the kdb+ pivot code (https://stackoverflow.com/questions/30789471/pivot-table-in-kdb-q) and that:
    trades_agg:1000#0!trades_agg
    Then providing a UI to select columns is simple.

    Example video: https://youtu.be/GyTQqKmymSU

    Steps:

    1. Add table trades_agg
    2. Add a Multi-select component with sql query: ([] c:cols trades_agg)
    3. Add a Multi-select component with sql query: ([] c:cols trades_agg)
    4. Add a Dropdown select component with sql query: ([] c:cols trades_agg)
    5. Add another table with the query: piv[trades_agg;(),<code>${{key1}}; (),${{key2}}; (),`${{key3}}]

    i.e. You want three variables, then to place those 3 variables into the piv function while making sure they are lists of symbols.

    kdb+ Pivot

    // see https://stackoverflow.com/questions/30789471/pivot-table-in-kdb-q
    // I then aggregate the data into equal sized buckets

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.