Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

cumulative count based on a key.

  Hi there,   I have a 'collect key' column and want to provide a number (in sequence) next to it for all trips that have the same key, and for this to repeat for all of the different keys.  What...
  • AlB's avatar
    AlB
    7 years ago

    If you can have an extra column with a unique, consecutive numerical ID (index), I think the code below should work. You can add an index column easily in the query editor (see the solution on this post)

     

     

    Table[Accumulated] =
    COUNTROWS (
        FILTER (
            Table;
            Table[Collect Key] = EARLIER ( Table[Collect Key] )
                && Table[ID] <= EARLIER(Table[ID])
        )
    )