How to calculate %of first row value in Looker calculated fields?

  • 5 May 2019
  • 1 reply

1 reply

Userlevel 7
Badge +1

Posting the reply from @will.adams on stack overflow:

offset(${total_users}, -1) is going to return the value in the row above the one running the calc, so you’re dividing each row by the row above it. To divide each value by the top row, you’ll want index(expression, n) , so the final calc would look like

${total_users} / index(${total_users}, 1)

index() returns the value expression in the n th row.