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+)
Already have an account? Login
Login to the community
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
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_indexhere). 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?
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_totalbut I want to know % of total for each row?
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.