Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Richard3
Contributor III
Contributor III

Table association

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;

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

See https://help.qlik.com/en-US/sense/November2022/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPref...

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;

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Use the "Concatenate (DateBridge)" prefix on your Loads. 

-Rob

Richard3
Contributor III
Contributor III
Author

Could you explain me an example please.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

See https://help.qlik.com/en-US/sense/November2022/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPref...

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;