Nested Pivots and Table Calculations

Knowledge Drop

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:

image.png

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.                

Version history
Last update:
‎07-07-2021 01:13 PM
Updated by: