Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Bastian22
Contributor
Contributor

Combine fields from two different tables with each element in field of other table

Hello.

I have three independent tables: "Turnos", "Ciclos" and "Calendario", which are generated using this code:

Calendario:
LOAD
Date($(vMinDate) + IterNo() - 1) AS Fecha
AutoGenerate 1
While $(vMinDate) + IterNo() - 1 <= $(vMaxDate);

Turno:
LOAD * Inline [
Turno,
Dia,
Noche
];

Ciclos:
LOAD * Inline [
Ciclo,
Combinado,
Simple
];

I need a table as below:

Fecha Turno Ciclo
8/02/2023 Dia Simple
8/02/2023 Dia Combinado
8/02/2023 Noche Simple
8/02/2023 Noche Combinado
9/02/2023 Dia Simple
9/02/2023 Dia Combinado
9/02/2023 Noche Simple
9/02/2023 Noche Combinado

 

To achieve it, I tried "join":

Master:
LOAD Calendario.Fecha AS Fecha resident Calendario;
join LOAD Turno.Turno AS Turno Resident Turno;
join LOAD Ciclos.Ciclo AS Ciclo Resident Ciclos;

 

Then, I get this table:

Bastian22_0-1675986300865.png

But, I didn't expected the "Turno-8" as part of the name of fields "Turno" and "Ciclo".

 

How can I avoid those unexpected names? Thank you.

Labels (3)
1 Reply
sidhiq91
Specialist II
Specialist II

@Bastian22  I tried with the similar code that you had mentioned above, but I did not get any issues field names. Please see the code that used in the back end:

NoConcatenate
Calendario:
Load Date(Date#(Fecha,'DD/MM/YYYY'),'DD/MM/YYYY') as Fecha
inline [
Fecha
21/12/2022,
22/12/2022
];

NoConcatenate
Turno:
LOAD * Inline [
Turno
Dia,
Noche
];

NoConcatenate
Ciclos:
LOAD * Inline [
Ciclo
Combinado,
Simple
];

NoConcatenate
Master:
LOAD Fecha AS Fecha resident Calendario;
join LOAD Turno AS Turno Resident Turno;
join LOAD Ciclo AS Ciclo Resident Ciclos;

Drop tables Calendario,Turno,Ciclos;

Exit script;

sidhiq91_0-1676000241552.png