Reputation:
This is a sample of my data
I am trying to get :
Thank you
Upvotes: 0
Views: 59
Reputation: 1269493
You can unpivot in BigQuery using unnest()
and arrays:
select t.holiday, t.segment, el.dte, el.booking
from t cross join
unnest(array[struct('1/1/2020' as dte, "1/1/2020" as booking),
struct('1/2/2020' as dte, "1/2/2020" as booking),
. . .
]
) el;
Upvotes: 2