Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
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.
@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;