Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two tables and I want all my information to be in a single table, how could I do it?
Here my tables:
DateBridge:
Load
booking_id,
booking_hotel as hotel_idd,
booking_chain as chain_idd,
reservation_date_hotel as canonicalDate,
Month(reservation_date_hotel) as MES,
Year(reservation_date_hotel) as AÑO,
Year(reservation_date_hotel)&Month(reservation_date_hotel) as Periodo,
amount_produced as Valor,
'reserved' as DateType
Resident bookings;
Load
booking_id,
booking_hotel as hotel_idd,
booking_chain as chain_idd,
cancellation_date_hotel as canonicalDate,
Month(cancellation_date_hotel) as MES,
Year(cancellation_date_hotel) as AÑO,
Year(cancellation_date_hotel)&Month(cancellation_date_hotel) as Periodo,
amount_produced as Valor,
'cancelled' as DateType
Resident bookings
where status = 'CANC';
Load
booking_id,
booking_hotel as hotel_idd,
booking_chain as chain_idd,
check_out as canonicalDate,
Month(check_out) as MES,
Year(check_out) as AÑO,
Year(check_out)&Month(check_out) as Periodo,
amount_produced as Valor,
'checkout' as DateType
Resident bookings;
Data:
Load
booking_id,
(AÑO+1)&MES as Periodo,
Valor as valor_anterior
resident DateBridge;
DateBridge:
Load
booking_id,
booking_hotel as hotel_idd,
booking_chain as chain_idd,
reservation_date_hotel as canonicalDate,
Month(reservation_date_hotel) as MES,
Year(reservation_date_hotel) as AÑO,
Year(reservation_date_hotel)&Month(reservation_date_hotel) as Periodo,
amount_produced as Valor,
'reserved' as DateType
Resident bookings;
Concatenate(DateBridge)
Load
booking_id,
booking_hotel as hotel_idd,
booking_chain as chain_idd,
cancellation_date_hotel as canonicalDate,
Month(cancellation_date_hotel) as MES,
Year(cancellation_date_hotel) as AÑO,
Year(cancellation_date_hotel)&Month(cancellation_date_hotel) as Periodo,
amount_produced as Valor,
'cancelled' as DateType
Resident bookings
where status = 'CANC';
Concatenate(DateBridge)
Load
booking_id,
booking_hotel as hotel_idd,
booking_chain as chain_idd,
check_out as canonicalDate,
Month(check_out) as MES,
Year(check_out) as AÑO,
Year(check_out)&Month(check_out) as Periodo,
amount_produced as Valor,
'checkout' as DateType
Resident bookings;
Use the "Concatenate (DateBridge)" prefix on your Loads.
-Rob
Could you explain me an example please.
DateBridge:
Load
booking_id,
booking_hotel as hotel_idd,
booking_chain as chain_idd,
reservation_date_hotel as canonicalDate,
Month(reservation_date_hotel) as MES,
Year(reservation_date_hotel) as AÑO,
Year(reservation_date_hotel)&Month(reservation_date_hotel) as Periodo,
amount_produced as Valor,
'reserved' as DateType
Resident bookings;
Concatenate(DateBridge)
Load
booking_id,
booking_hotel as hotel_idd,
booking_chain as chain_idd,
cancellation_date_hotel as canonicalDate,
Month(cancellation_date_hotel) as MES,
Year(cancellation_date_hotel) as AÑO,
Year(cancellation_date_hotel)&Month(cancellation_date_hotel) as Periodo,
amount_produced as Valor,
'cancelled' as DateType
Resident bookings
where status = 'CANC';
Concatenate(DateBridge)
Load
booking_id,
booking_hotel as hotel_idd,
booking_chain as chain_idd,
check_out as canonicalDate,
Month(check_out) as MES,
Year(check_out) as AÑO,
Year(check_out)&Month(check_out) as Periodo,
amount_produced as Valor,
'checkout' as DateType
Resident bookings;