Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
If you are a Qlik Insight Bot user, join this collaborative group: JOIN GROUP
Not applicable

Join three tables with different fields

Hello all,

I'm new with Qlikview and don't know how to go on now.

I got three tables:

KST:

CostCenterNumber

CostCenterDescription

DATA:

CostCenterDescription

Value1

Value2

WorkedHours:

CostCenterNumber

HoursWorked

I need to link DATA (includes sales etc.) with WorkedHours to now how many hours used for made sales. Problem is, that I got CostCenterNumber in the WorkedHours and CostCenterDescription in the Data, the translation is in KST.

How do I have to script that?

The three tables come from Excel.

Many thanks for your help in advance!

Christoph

Tags (2)
1 Solution

Accepted Solutions
Highlighted

Re: Join three tables with different fields

to be sure not to exclude any value you can use Always join:

Load * From KST;

join

load * from DATA;

join

load * from WorkedHours;

But I think that the problem comes from different CostCenterDescription,

try, when you load the 2 tables with the field CostCenterDescription to:

Load

...

Upper(Trim(CostCenterDescription)) as CostCenterDescription

...

View solution in original post

6 Replies
Highlighted

Re: Join three tables with different fields

Load * From KST;

left join

load * from DATA;

left join

load * from WorkedHours;

replace the load * .... with the loading from Excel.

Let me know

Highlighted
Not applicable

Re: Join three tables with different fields

No that doesn't lead to correct results.

Another problem I have forgotten to tell is that I got more CostCenters in "WorkedHours" than in "Data", of course I need to keep them.

Highlighted

Re: Join three tables with different fields

So try with

Load * From KST;

left join

load * from DATA;

join

load * from WorkedHours;

Highlighted
Not applicable

Re: Join three tables with different fields

Now I got the correct summaration of hours but no values from the DATA table, its all gone.

Highlighted

Re: Join three tables with different fields

to be sure not to exclude any value you can use Always join:

Load * From KST;

join

load * from DATA;

join

load * from WorkedHours;

But I think that the problem comes from different CostCenterDescription,

try, when you load the 2 tables with the field CostCenterDescription to:

Load

...

Upper(Trim(CostCenterDescription)) as CostCenterDescription

...

View solution in original post

Highlighted
Not applicable

Re: Join three tables with different fields

Wow! That seems to be the solution, great! Thanks a lot. I will have a few more checks now.

Have a nice weekend so far