Have pivoted dimension under the measures so you can compare side-by-side

I have two items that I want to compare on a few different metrics. Unfortunately, the Table look seems to only allow the pivot dimension on top of the measures. While I understand how this limitation may seem logical, it makes it quite difficult to compare the pivoted columns, which somewhat defeats the purpose of pivoting in the table. 

This is my data table in BigQuery

DateItemMetric 1Metric 2Metric 3
JanuaryA933200
JanuaryB10066400
FebruaryA933200
FebruaryB10066400
MarchA933200
MarchB10066400

I can load this in Looker and easily pivot this to:

 A  B  
Date123123
February93320010066400
January93320010066400
March93320010066400

But what I really want to do is compare A and B, not 1 2 and 3 within A: 

 1 2 3 
DateABABAB
February91003366200400
January91003366200400
March91003366200400

However, this layout of the table seems impossible in Looker without completely restructuring the data into long/tidy format and then doing a complicated join. I know how to do this in Excel/Sheets and Tableau, so I am surprised it's so difficult in Looker.

Is there a way to show the third table from the first table? The second table is very user unfriendly for this use. I am using Looker Core.

0 6 173
6 REPLIES 6

Isn't this just changing the pivot order? Seems like in second table you pivoted first table by Item first and then pivoted by Date. If you did the opposite order does that not work for you?

You can't "just change" the pivot order as far as I can tell with tables in Looker Core. I agree it's a simple change in concept.

It's also not two pivots. It's one pivot. You pivot "Item", while "Date" remains as an unpivoted dimension and Metrics are measures. The metrics aren't dimensions and can't be pivoted like that. 

What you're describing only works if you do a long/tidy table for your dataset:

DateItemMetricValue
JanuaryA19
JanuaryB1100
JanuaryA233
JanuaryB266
JanuaryA3200
JanuaryB3400
FebruaryA19
FebruaryB1100
FebruaryA233
FebruaryB266
FebruaryA3200
FebruaryB3400
MarchA19
MarchB1100
MarchA233
MarchB266
MarchA3200
MarchB3400

But that's not how the data is set up and that's not how BigQuery works. The data is set up in the tabular form in the first table, so you have Metric 1, Metric 2, Metric 3 as columns, not Metric/Value.

To get from tabular to long format would require a transformation and a join and some development work to make sure it all integrates nicely. This is doable but much more intensive than it should be. So I was hoping to find a way to use the tabular data (since that's how most data is shaped and how BigQuery works).

ahhh ok yea idk how you'd do that in Looker without a PDT or a different table

yeah that's my fear

Would maybe native derived tables work? The measures will be treated as dimensions in the derived table, the new creator is just a click path and it would rely on the original LookML.

interesting, thank you. i will definitely explore this. it's not as simple or elegant as i was hoping but this may be our best bet to show the data in a way that's most useful for our customer

Top Labels in this Space
Top Solution Authors