The content of this article has been moved into Looker’s technical documentation here.
[RETIRED] How to refer to totals and row totals in table calculations (3.24+)
This is great! I’ve wanted this feature a few times over the last little while. Love it 😀
Can you access the ‘total of totals’, i.e. the bottom right cell when you have both ‘totals’ and ‘row totals’ checked?
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?)
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!
How about in LookML?
Hi
Currently, you can only reference pivot values in table calculations, but I’ll make sure our product team is aware of that suggestion!
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?
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.