Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Problem with my Join Statement

Hello, I have two tables in QlikView, a Header table and an items table.  There is a one (header) to many (items) relationship between the two.  They are loaded as sunch (one after another):  The 3 Uniques are unique only when combined into DocKey

Load
   
Unique1 & Unique2 & Unique3 as %DocKey,
   
Unique1,

    Unique2,

    Unique3,

    HeaderNumber

    HeaderInfo1
   
FROM (qvd)

LOAD
   Unique1 & Unique2 & Unique3 as %DocKey,
   
Unique1,

    Unique2,

    Unique3,

    ItemNumber

    ItemPrice
FROM (qvd)

The problem is that evey load combination I have tried fails, I either can use ItemNumber and ItemPrice OR HeaderNumber and HeaderInfo but I cannot use all, but the joins all work but the tables remain the same.

Any ideas?

Thanks in advance!

Tags (2)
1 Solution

Accepted Solutions

Re: Problem with my Join Statement

If you do:

Load
   
Unique1 & Unique2 & Unique3 as %DocKey,
   
Unique1,

    Unique2,

    Unique3,

    HeaderNumber

    HeaderInfo1
   
FROM (qvd)

join

LOAD
   Unique1 & Unique2 & Unique3 as %DocKey,
   
Unique1,

    Unique2,

    Unique3,

    ItemNumber

    ItemPrice
FROM (qvd)

the result will alwayzs be only 1 table containinng all the combinations from the two. If you mean instead of join a association then you have to do:

HEAD:

Load
   
Unique1 & Unique2 & Unique3 as %DocKey,
   
Unique1,

    Unique2,

    Unique3,

    HeaderNumber

    HeaderInfo1
   
FROM (qvd);

ITEM: noconcatenate

LOAD
   Unique1 & Unique2 & Unique3 as %DocKey,
   
Unique1,

    Unique2,

    Unique3,

    ItemNumber

    ItemPrice
FROM (qvd)

3 Replies

Re: Problem with my Join Statement

If you do:

Load
   
Unique1 & Unique2 & Unique3 as %DocKey,
   
Unique1,

    Unique2,

    Unique3,

    HeaderNumber

    HeaderInfo1
   
FROM (qvd)

join

LOAD
   Unique1 & Unique2 & Unique3 as %DocKey,
   
Unique1,

    Unique2,

    Unique3,

    ItemNumber

    ItemPrice
FROM (qvd)

the result will alwayzs be only 1 table containinng all the combinations from the two. If you mean instead of join a association then you have to do:

HEAD:

Load
   
Unique1 & Unique2 & Unique3 as %DocKey,
   
Unique1,

    Unique2,

    Unique3,

    HeaderNumber

    HeaderInfo1
   
FROM (qvd);

ITEM: noconcatenate

LOAD
   Unique1 & Unique2 & Unique3 as %DocKey,
   
Unique1,

    Unique2,

    Unique3,

    ItemNumber

    ItemPrice
FROM (qvd)

Re: Problem with my Join Statement

Load
   
Unique1,

    Unique2,

    Unique3,

    HeaderNumber

    HeaderInfo1
   
FROM (qvd)

Join

LOAD
   
Unique1,

    Unique2,

    Unique3,

    ItemNumber

    ItemPrice
FROM (qvd)

Not applicable

Re: Problem with my Join Statement

Thanks!  You should seee how complex I tried to make it.  This will give a proper one to many join???...I am testing now mut locally and there is a lot of data....It looks loke does, I will take a look at the refresh just finished.  I juess creating the %DocKey is not necessary as it will connect on the Unique keys automatically?

Community Browser