how to return first row of data

  • 17 August 2021
  • 0 replies

The problem

Let's say you have a table like so:

Screen Shot 2021-02-02 at 11.46.31 AM.png

And you want to return only the first row of data in a single column.


The solution

We can accomplish this by using this function here:

pivot_index(index(${number_of_sign_ups.count}, 1), row())


The explanation

Index(orders.count, 1) is specifying to return values from the 1st row, and pivot_index(X, row()) is saying that for each row that exists, return the value within the index function that corresponds to the pivoted column matching the row number.

0 replies

Be the first to reply!