Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Issue with JOIN

  Hello experts,

I am facing some strange problem with join. All the fields A, B, C, D are loaded in text format in qlikview and getting joined. But somehow join is not working correctly if you can have a look and share your view.

Table A : coming from spreadsheetTable B: coming from qvd
ABCDflagABCDItem
3000107432300010743S1
3000108433300010743S2
300010743S3
300010743S4
TABLE A JOIN TABLE BIdeally this should be the result
ABCDflagItemABCDflagItem
30001074323000107432S1
300010743S13000107432S2
300010743S23000107432S3
300010743S33000107432S4
300010743S43000108433
3000108433

Thanks


1 Solution

Accepted Solutions
sunny_talwar

Yes, if you are using a direct join using a wildcard in your load, it will not work. This is what you need to do in that case

Table:

LOAD *

FROM Path/2016*;

Left Join (SomeTable)

LOAD *

Resident Table;

DROP Table Table;

View solution in original post

10 Replies
sunny_talwar

Would you be able to provide this sample data in a Excel file?

Anonymous
Not applicable
Author

i did. Table B coming from qvd

sinanozdemir
Specialist III
Specialist III

Hi,

The below works

Capture.PNG

And produces the expected result:

Capture.PNG

maxgro
MVP
MVP

maybe you have a flag field in the qvd?

Directory;

A:

LOAD A, B,

     C, D,

     flag

FROM

Book1.xlsx

(ooxml, embedded labels, table is excel);

B:

LOAD A, B,

     C, D,

     Item

FROM

Book1.xlsx

(ooxml, embedded labels, table is qvd);

STORE * from B into B.qvd (qvd);

DROP Table B;

// if I add a non matching flag, I get 6 rows

join (A) load *, null() as flag

from B.qvd (qvd);

1.png

Anonymous
Not applicable
Author

No Sinan that is not the case. In principle if format and values are same then join should definitely work but unfortunately that's not happening in this case. I know that the way I have provided data to sunny I load it in qlikview and run it will work. I am just looking for anybody who has come across this experience.

Anonymous
Not applicable
Author

One more thing that I have noticed if I don't force join TABLE A and TABLE B and keep them separate in data model and let them associate with each other, I get the correct result.  The problem starts when I do join.

 

ABCDflagItem
3000107432S1
3000107432S2
3000107432S3
3000107432S4
3000108433
Anonymous
Not applicable
Author

One more observation- join works correctly with a single qvd load but when I load data from a series of qvd using sth like '/2016*', that's where join starts working erroneously. Any comment?



sunny_talwar

Yes, if you are using a direct join using a wildcard in your load, it will not work. This is what you need to do in that case

Table:

LOAD *

FROM Path/2016*;

Left Join (SomeTable)

LOAD *

Resident Table;

DROP Table Table;

sunny_talwar

I cannot find where, but I heard  saw (in one of the posts)hic‌ mentioning that loading the files using a loop is a better option then using wildcards. If I remember correctly, he mentioned that he barely use wildcard anymore.