Hi 👋,
I need help defining a time dimension for a Looker chart where different metrics have different date fields.
I am working with opportunities data, and I want to track three key metrics by week and by country:
Each metric is based on a different date field, but I want them to appear on the same chart to compare weekly performance.
opportunity_id | country | created_at | proposal_sent_date | won_date |
101 | US | 2024-03-01 | 2024-03-05 | 2024-03-10 |
102 | US | 2024-03-02 | 2024-03-06 | NULL |
103 | UK | 2024-03-04 | 2024-03-08 | 2024-03-12 |
104 | UK | 2024-03-07 | NULL | NULL |
Metric | W1 | W2 | W3 |
opportunities_created | 10 | 15 | 12 |
opportunities_proposal_sent | 8 | 12 | 10 |
opportunities_won | 5 | 7 | 6 |
Each metric should be counted based on its respective date field within the corresponding week.
How do I define the weekly time dimension (W1, W2, W3) when each metric uses a different date field? I want to see those matrics on one table chart.
Solved! Go to Solution.
I don't know if this possible with just that table. You need single unifying date dimension to get the week and group by to get those metrics. I would prob redesign that table so it's one action per row and the date of that action. If you had that, you could group by the action(eg created, proposal sent, won) and pivot by action date and a count measure
I don't know if this possible with just that table. You need single unifying date dimension to get the week and group by to get those metrics. I would prob redesign that table so it's one action per row and the date of that action. If you had that, you could group by the action(eg created, proposal sent, won) and pivot by action date and a count measure