Skip to content

Allow nth_value to take a column as the 'nth' argument #375

@ae3e

Description

@ae3e

I would like to use the nth_value function with a nth parameter coming from an another column (see the example below).
But it fails. I don't really know if it's the expected behavior or if there's something wrong?

aq
  .table({
    value: [69, 108, 178, 207, 253, 268, 312, 281, 221, 142, 72, 52],
    index: [3, 2, 3, 5, 6, 8, 2, 2, 7, 5, 4, 5]
  })
  .derive({
    nth: (vv) => aq.op.nth_value(vv.value, vv.index)
  })

gives an error RuntimeError: data is not defined

nth always has to be a constant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions