Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
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!

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

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)

View solution in original post

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

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)

MK_QSL
MVP
MVP

Load
   
Unique1,

    Unique2,

    Unique3,

    HeaderNumber

    HeaderInfo1
   
FROM (qvd)

Join

LOAD
   
Unique1,

    Unique2,

    Unique3,

    ItemNumber

    ItemPrice
FROM (qvd)

Not applicable
Author

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?