Question

Can I merge two tables?

  • 4 January 2019
  • 2 replies
  • 2362 views

Two tables: one shows me my sales by day by store the other shows me sales this week to date by store. I really need this all in one table. Will this be possible to merge the two?


2 replies

You could do a SQL UNION in the looker view. You could do it at query time or create a PDT (materialized view).


SELECT user_id, sale_date, sales_total
FROM online_sales
UNION
SELECT user_id, sale_date, sales_total
FROM offline_sales

Then create your look on top of that data.

The Merged Results functionality should be able to help you with this.


Reply