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

Inner Join in Load SQL Load Statement

Hi All,

I'm am running into some trouble with my inner join statement. I am bringing in the correct number of observations from 'Table 1' but when inner joining using syntax below, Qlik is bringing in all records from the other tables, not only where the tables are mutual...

Suggestions? Thank you!

SQL SELECT ITMSNumber,Prioritization,SCA,DATALOADSTATUSID, LOADPRIORITYSTATUSID
FROM MPL.dbo.tblSTRATEGY
where loadprioritystatusid=20 or loadprioritystatusid=30 or loadprioritystatusid=100;

Inner Join(Table1)
SQL SELECT *
FROM MPL.dbo.tblAPPINVENTORY;

Inner Join(Table1)
SQL SELECT Acronym,
ITMSNumber,
Name
FROM MPL.dbo.tblBASIC;

4 Replies
maxgro
MVP
MVP

some suggestions:

stop the script after the first inner join: do you get the expected result?

which fields are you using for joining the first 2 tables? are the values of these fields duplicated?



Inner Join(Table1)
SQL SELECT *
FROM MPL.dbo.tblAPPINVENTORY;

exit script;

Not applicable
Author

Hi Massimo,

I did not get the expected results when stopping the script after the first join...

All the tables that I am joining together have a common field 'ITMSNumber' that I am looking to join on. The values in each of these tables are distinct, no duplicate entries in either table.

Clever_Anjos
Employee
Employee

As all your tables resides into same database I would use the SQL join, not the Qlik.

It would perform much better

SELECT ITMSNumber,Prioritization,SCA,DATALOADSTATUSID, LOADPRIORITYSTATUSID, morefields

FROM MPL.dbo.tblSTRATEGY a

inner join MPL.dbo.tblAPPINVENTORY b on ( join clauses goes here)

inner join MPL.dbo.tblBASIC c on ( join clauses goes here)

where loadprioritystatusid in (20,30,100);

maxgro
MVP
MVP

I did not get the expected results when stopping the script after the first join.

and what's the problem?

duplicated ITMSNumber? loadprioritystatus not in (20,30,100)?

could you post the .qvw or a screenshot of the result table with the problem?