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

using right join incorrectly

Hi .. I'm a newbie and trying a simple script with the intent of a RIGHT JOIN

Basically - I want all of the hostnames from the dSeries table and only the matching ones from the ODBC load (Snapshot) table.


dSeries:
LOAD PROD as 'dSeriesENV',
Hostname as 'dSeriesHostname',
ShortHostname as 'hostname'
FROM

(
ooxml, embedded labels, table is BOTH);

right join (dSeries)

ODBC CONNECT TO REPO_ODBC (XUserId is SUWDDRFNfKYGWRVMTbcSD, XPassword is CEaFfSFMNDNEWUZR);
Snapshot:
select hostname
, status as 'itamstatus'
, osplatform as 'itamosplatform'
, os as 'itamos'
, osversion as 'itamosversion'
from itam_reporting.reporting.snapshothw_current
where sigappitnonit = 'vzw';


Any ideas?

1 Solution

Accepted Solutions
nagaiank
Specialist III
Specialist III

Try the following script:

No single quotes for field names and what you need is a left join.


dSeries:
LOAD PROD as dSeriesENV,
Hostname as dSeriesHostname,
ShortHostname as hostname
FROM

(
ooxml, embedded labels, table is BOTH);


ODBC CONNECT TO REPO_ODBC (XUserId is SUWDDRFNfKYGWRVMTbcSD, XPassword is CEaFfSFMNDNEWUZR);


LEFT join (dSeries)
select hostname
, status as itamstatus
, osplatform as itamosplatform
, os as itamos
, osversion as itamosversion
from itam_reporting.reporting.snapshothw_current
where sigappitnonit = 'vzw';

View solution in original post

3 Replies
sunny_talwar

You need a same field name between the two tables where you are right joining them on. I don't see any common field names in the two tables. Rename the two fields which they are supposed to be Right Joined on and I think it should work for you.

My bad, is it getting right joined on hostname?

nagaiank
Specialist III
Specialist III

Try the following script:

No single quotes for field names and what you need is a left join.


dSeries:
LOAD PROD as dSeriesENV,
Hostname as dSeriesHostname,
ShortHostname as hostname
FROM

(
ooxml, embedded labels, table is BOTH);


ODBC CONNECT TO REPO_ODBC (XUserId is SUWDDRFNfKYGWRVMTbcSD, XPassword is CEaFfSFMNDNEWUZR);


LEFT join (dSeries)
select hostname
, status as itamstatus
, osplatform as itamosplatform
, os as itamos
, osversion as itamosversion
from itam_reporting.reporting.snapshothw_current
where sigappitnonit = 'vzw';

qlikviewwizard
Master II
Master II

Hi,

Use NagaianKs advise.It will works.