Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Valued Contributor III

Re: using right join incorrectly

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';

3 Replies

Re: using right join incorrectly

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
Valued Contributor III

Re: using right join incorrectly

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';

Arjunarao
Honored Contributor II

Re: using right join incorrectly

Hi,

Use NagaianKs advise.It will works.