Knowledge Drop

Nested Pivots and Table Calculations

Last tested: Apr 27, 2020

If you have nested pivots, this can make pivot_where/pivot_index very complex to use. You would think you would need to nest the calls to pivot_where/pivot_index within each other. But no, that would make too much sense.

Instead, we need to use AND logic. So for example, look at this explore:


This gets the nested pivot column where the status is complete for the 4th quarter:

pivot_where(${orders.status} = "complete" AND to_string(${orders.created_quarter}) = "2019-10", ${orders.count})


This content is subject to limited support.                



0 replies

Be the first to reply!