KX Community

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

Home Forums kdb+ Accumulators – Access additional list / column Re: Accumulators – Access additional list / column

  • rocuinneagain

    Member
    September 5, 2022 at 12:00 am

    Looking at your expected c2 this logic may be what you are looking for:

     

    q)update c2:fills ?[(c1>prev c1) or c<prev c1;c1;0N] from t 
    c c1 c2 
    -------- 
    30 10 10 
    40 20 20 
    25 5 20 
    20 25 25 
    4  5  5 
    4  4  4