Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
expeditor
Contributor
Contributor

some kind of "double" left join ?

Hallo,

Ich habe eine Tabelle "Start", in der mir bestimmte Werte in unterscheidlichen Feldern fehlen. Manche Zeilen haben aber auch schon alle nötigen Werte (hier z.B. Datum: 29.05.2109 & 30.05.2019).

In der Tabelle "Comparison" habe ich eine Gegenüberstellung aus der ich mir die fehlenden Werte in die Tabelle "Start" holen möchte.

Ich habe es mit Left-Joins in Kombination mit WHERE versucht, bekomme aber nichts brauchbares und glaube das ich auf dem völlig falschen Weg bin.

Könnte mir jemand mit dem Skript Code unten vielleicht eine Lösung zeigen?

Beispiel.jpg

 

Skript Code:

QUALIFY *;
UNQUALIFY '%*';

Start:
LOAD * INLINE [
Datum, Kundenauftrag, Fertigungsauftrag
23.05.2019, 3111111,
24.05.2019, 3222222,
25.05.2019, 3333333,
26.05.2019, , 8111111
27.05.2019, , 8222222
28.05.2019, , 8333333
29.05.2019, 3777777, 8444444
30.05.2019, 3888888, 8555555
31.05.2019, , 4111111
01.06.2019, , 4222222
02.06.2019, , 4333333
];


Comparison:
LOAD * INLINE [
Kundenauftrag, Fertigungsauftrag
3111111, 8121212
3222222, 8232323
3333333, 8343434
3121212, 8111111
3232323, 8222222
3343434, 8333333
3777777, 8444444
3888888, 8555555
, 4111111
, 4222222
, 4333333
];

// Trying to create "what I need"

left join (Start)
LOAD
Comparison.Kundenauftrag as Start.Kundenauftrag,
Comparison.Fertigungsauftrag as Start.Fertigungsauftrag
Resident Comparison
Where Start.Kundenauftrag <> NULL();


left join (Start)
LOAD
Comparison.Kundenauftrag as Start.Kundenauftrag,
Comparison.Fertigungsauftrag as Start.Fertigungsauftrag
Resident Comparison
Where Start.Fertigungsauftrag <> NULL();

UNQUALIFY *;

 

VIELEN DANK / THANK YOU

Marc

Labels (2)
1 Reply
cbushey1
Creator III
Creator III

Hi there,

I am not sure what your "key" field is in the START table but it looks like date. You could create a map table and utilize the applymap function when you create the START table that will pull in the values from the Comparison table.