Is there a way to limit the X Axis Range

I currently have 30 minute time slots, ranging from 08:00 to 20:00.
My data set is a series of rows that countain information of when a collection and the respective delivery happened within these time slots.

GoncaloFVO_0-1712860539268.png

I would like to display this information in a bar chart, representing the ammount of times a pickup or delivery occured in that time slot.


My first question is if it would be possible to only represent this using just 1 chart and being able to distinguish them by color, similar. From my understanding this seems to be impossible, which leads me to my second approach/problem:

I thought of creating 2 separate charts, one regarding the pickup time slots and the other representing the delivery time slots, and the stack them on top of each other. However,  I am not able to limit the X Axis range and one chart is starting at 08:00, while the other is starting at 07:00 (no idea why, since it is impossible for that time slot to have any records)

GoncaloFVO_1-1712860558328.png

They both have a 24 bar limit. Also, there are over 40 records for the 20:00 time slot, but looker for some reason prefers to display the empty 07:00 time slot instead of the 20:00 .

 

0 1 46
1 REPLY 1

So, I'm not sure how to fix the X-axis issue. But, I think I can help you get this into a single chart!

This is a little involved, so bear with me. We're basically going to create a base table of time slots, and then join your data to it twice - once on pickup time and once on delivery time. Then the two counts from these two "tables" will be the pickup and delivery counts you're looking for. 

Step 1: Create a new Base Slots data source that has all possible slots for pickup or delivery. I just put some slots down in Google Sheets and connected that.

sam8_0-1714596472224.png

 

Step 2: Blend the original data source to the base slots data source twice. The way I did it was starting from the original data source as "pickups", then right joining that to the base slots on pickup slot == base slot. Then, I left joined the original data source, this time as "deliveries", on base slot == delivery slot.

sam8_1-1714596633920.png

 

sam8_2-1714596641915.png

 

sam8_3-1714596649713.png

 

Step 3: Create a bar chart with the base slots as the dimension, and both record counts as the metrics. One record count will represent pickups, and the other deliveries.

sam8_4-1714596699087.png

 

I hope this helps! Sorry it's kind of long and convoluted!

Top Labels in this Space