Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Daten verknüpfen /Relate Data

ENGLISH VERSION BELOW

Hallo zusammen,

ich habe folgendes Problem:

Ich ziehe aus 2 Excel Datein jeweils eine Tabelle. Beide Tabellen enthalten das ein Datum. Bzw genauer gesagt enthält Tabelle1 ein Datum des Formates DD.MM.YYYY und Tabelle 2 einfach den Namen der Monate Januar, Februar,...

Ich möchte diese nun miteinander Verknüpfen, sodass wenn ich in meinem Masterkalender "Januar" auswähle, er sowohl alle Daten aus Tabelle 1 als auch aus Tabelle 2 filtert.

Die Daten des Formates DD.MM.YYYY zu filtern funktioniert. Das andere auch. Leider aber nur beide für sich und nicht beide zusammen.

In meinem Masterkalendar habe ich Inline eine Monatszuordnung vorgenommenm, damit ich für die Daten des Formats DD.MM.YYYY eine Wahlmöglichkeit "Monat" habe.

Verknüpfe ich nun beide Tabellen, indem ich der Spalte aus Tabelle 2 den Namen "Monat" gebe, kritisiert Qlikview, dass ich einen Zirkelschluss habe.

Ich will also quasi nicht, dass er beide Tabellen untereinander zusammenfügt (wie mit JOIN, oä), sondern dass sie sozusagen nebeneinander verknüft sind.

Sprich ich wähle "Januar" im Masterkalender und er filtert in beiden Tabellen nach "Januar"

Ich schaffe es quasi nur Tabelle 1 mit dem Materkalender zu verknüpfen, jeodch nicht beide zusammen.

Hello,

I have a problem:

i import 2 Excel files. Both files have a date. Table1 has a date with the format DD.MM.YYYY. Table2 only contains months: January,..

What i want is to relate both tables to the mastercalendar. I want so choose 'January' in the mastercalendar and then Qlik should filter both tables. Table1 works with the mastercalendar and table2 as well. But not both at the same time. If i name the column in table2 'Month', it doesnt work, because i used 'month' in the mastercalendar and Qlik says that i have a circular argument. I tried JOIN and so on, but it doesnt work.

How do i relate both tables to the mastercalendar without combining both tables in one?

9 Replies
sunny_talwar

Something along these lines:

Table1:

LOAD AllFields,

          Date#(Date, 'DD.MM.YYYY') as Date

FROM Table1;

Table2:

LOAD AllFields,

          Date(MakeDate(Year(Today()), Month(Date#(Date, 'MMMM')))) as Date

FROM Table2;

MarcoWedel

Hallo Jan,

kannst Du bitte eine Beispielapplikation posten, die Deine Tabellen und Verknüpfungen zeigt, sowie den relevanten Teil Deines Load Skripts?

Danke

Gruß

Marco

swuehl
MVP
MVP

I agree with Marco, we need to know a bit more about your data model and data.

If you get a circular loop, there must be a third table involved, probably one that also shows "Monat" field. (Or is "Masterkalender" your third table? Well, that would explain something...edit: and it's getting clearer in your english text version)

It might also be helpful if you could explain a bit more detailed what you want to achieve with these two tables, keeping them as spearate, linked tables.

In general, you could consider concatenating your two excel tables in one resident table, or using a link table that links all three tables (two excel with master calendar), hence the tables won't link directly, only via the link table.

Maybe it's just enough if you create a Date field in both Excel file table loads (one already shows this "Datum" field, second date field will be derived from "Monat", e.g. start of month, or each date of a month) and only use this "Datum" field to link your three tables (this would then be similar to what Sunny suggested).

But without understanding what you want to achieve, it's hard to be more specific.

Regards,

Stefan

Not applicable
Author

Hey guys,

thanks so far.

Load Table1

for each vSheet in 'pre_kanne', 'cutter1', 'pre_robo', 'heizplatte_preformzelle', '"rtm70-1"', '"rtm70-3"', 'rtm150', 'rtm240', 'swissmulti2', '"rtm300-1"', '"rtm300-2"', '"rtm300-3"', '"rtm300-4"', 'hochdruck', '"rtm300-5"', '"rtm300-6"', 'swissmulti5', '"rtm300-7"', '"rtm 300-8"', 'rtm650', 'swissmulti4', 'rtm1600', 'swissmulti3', 'vga1', 'vga2', 'vga3', 'ausschmelzofen_neu', 'ausschmelzofen_alt', 'poseidon', 'ares1', 'ares2', '"Dekumed Klebe-DA"', 'strahlanlage'
Maschinen_Daten:
LOAD
O as XXXXX,
U as Störungscode,
Q as Anlagenstörung,
R as Rüsten,
S as Wartung,
T as Reinigung,
V as Maschine
FROM
[stillstandszeiten_2016.xlsx]
(
ooxml, no labels, header is 22 lines, table is $(vSheet));
NEXT;



Load Table2

for each vSheet in 'pre_kanne', 'cutter1', 'pre_robo', 'heizplatte_preformzelle', '"rtm70-1"', '"rtm70-3"', 'rtm150', 'rtm240', 'swissmulti2', '"rtm300-1"', '"rtm300-2"', '"rtm300-3"', '"rtm300-4"', 'hochdruck', '"rtm300-5"', '"rtm300-6"', 'swissmulti5', '"rtm300-7"', '"rtm 300-8"', 'rtm650', 'swissmulti4', 'rtm1600', 'swissmulti3', 'vga1', 'vga2', 'vga3', 'ausschmelzofen_neu', 'ausschmelzofen_alt', 'poseidon', 'ares1', 'ares2', '"Dekumed Klebe-DA"', 'strahlanlage'
LOAD Distinct
A as XXXXX,
H as Sollzeit,
I as OEE,
M as Maschine
FROM
[stillstandszeiten_2016.xlsx]
(
ooxml, no labels, header is 6 lines, table is $(vSheet));
NEXT;



Load INLINE

Left Join Maschinen_Daten:
Load Distinct
XXXX,
Week(XXXXX) AS Woche,
WeekDay(XXXXX) AS Tagname,
Month(XXXXX) AS Monat,
Year(XXXXX) AS Jahr
Resident
Maschinen_Daten;


The inline part is to create the following:

Unbenannt.PNG


XXXXX is the Date. In Table1 it is DD.MM.YYYY and in Table2 it is only the name of the month.

If i use the same name for XXXXX, i have a circular loop.

If i use different names, they are of course not related to each other.

What i want: If i choose for example May in the calendar above, Qlik shuold filter both Tables.

He should show every Data with dates in May form table1 and  the line with the data from month May in table2

MarcoWedel

Hallo Jan,

kannst Du bitte noch jeweils eine Excel Datei mit einigen Beispielzeilen für beide Tabellen posten?

Danke

Gruß

Marco

Not applicable
Author

Gerne, wenn du mir sagst, wo ich hier Datein anhängen kann 😉

Ich kann soweit ich das hier sehe nur Bilder und Videos anhängen

swuehl
MVP
MVP

'Erweiteren Editor' auswählen, wenn du im sog. Standardeditor bist (Link oben rechts im editor).

Dann gibt es unten einen Button zum Anhängen von Files.

Not applicable
Author

Danke. Hoffentlich funktioniert es.

Nur um Missverständnisse zu vermeiden: Ich habe 2 Loads, die sich auf die selbe Datei (die im Anhang) beziehen.

Die beiden Spalten, aus denen ich Monat bzw Datum ziehe sind rot makiert.

swuehl
MVP
MVP

Hallo Jan,

sieht für mich auf den ersten Blick so aus, als ob die Tabelle mit Monatsfeld eigentlich eine Aggregierungstabelle / Übersichtstabelle / Summentabelle der Tabelle mit dem Datumsfeld ist,d.h. dass du deren Inhalt eigentlich zur Laufzeit aus der detaillierten Faktentabelle gewinnen kannst.

Ist das so?

Dann würde ich die Tabelle mit Monat gar nicht laden, sondern die Faktentabelle einfach an den Masterkalender anbinden. Dann kannst du beliebige Kalenderfelder als Dimension benutzen.

Falls das nicht so ist, sind die beiden Tabellen wahrscheinlich nicht nur durch durch Datum / Monat in Bezug zu setzen, sondern auch noch durch andere Schlüssel. Anlagenbezeichnung?

Vielleicht kannst du ein Beispiel mit Daten in der Monatstabelle hochladen und das gewünschte Analyseergebnis (z.B. als Exceltabelle). Und wenn möglich die Tabellen nicht auf ein Excelsheet packen, sondern per Tabelle einen Reiter.

Gruß,

Stefan

edit: ups, jetzt habe ich komplett auf Deutsch umgeschaltet, obwohl das eigentlich ein englisches Forum ist...

       Sorry for answering in german, I've missed that this was posted to an international forum place.