Question

[RETIRED] How to refer to totals and row totals in table calculations (3.24+)

  • 1 July 2015
  • 8 replies
  • 704 views

Userlevel 5
Badge

The content of this article has been moved into Looker’s technical documentation here.


8 replies

Userlevel 2

This is great! I’ve wanted this feature a few times over the last little while. Love it 😀

Userlevel 2

Can you access the ‘total of totals’, i.e. the bottom right cell when you have both ‘totals’ and ‘row totals’ checked?

Userlevel 1

What if you wanted to take the average of a row instead of the total – is there a way to do that without pivot_offset? (Or is there a way to pass the number of columns to a calculated measure, which would be divided from the measure’s row_total?)

Userlevel 5
Badge

Hey Rob - the best way to do this with a pivoted table would be to add up each value in the row using pivot_index. This allows you to refer to the index of each column (more about using pivot_index here). This would then create a total value, that you can divide by the number of columns.


We don’t currently have a way to do table calcs across rows (or automatically calculate how many pivoted columns there are), but I will pass that on to our product team!

Userlevel 2

How about in LookML?

Userlevel 1

Hi @Hendrik


Currently, you can only reference pivot values in table calculations, but I’ll make sure our product team is aware of that suggestion!

Userlevel 7
Badge +1

Is it possible to reference total of totals in table calculations? I have my row_total but I want to know % of total for each row?

Userlevel 7
Badge +1

Is this referring to the same table-calc related question as the other thread? Or is it separate— I’m not sure if I understand the distinction.

Reply