Can I merge two tables?


(Ethan Blitstein) #1

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?


(Sonny Rivera) #2

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.


(Nick Morrison) #3

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