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.

steveniow
Not applicable

Where not exists removes all records

Hi,

I have two tables, one of which contains a Key (PathwayNumber) that I need to remove based on its existence in the other. the data against each key is different albeit that the Key is the same.

I have tried a couple of variations but most recently the script looks like below. Without the Not Exists I have just over 5000 records in table1 and a couple of million in table 2. With the statement, table 2 is empty.

Can anyone tell me what I am doing wrong?

The script looks like this:

table1:

LOAD InternalPatientNumber as IntNo,
EpisodeNumber as EpiNo,
PathwayNumber & '|' & PPeriodId as PNkey,
'Y'
as Inpatient,
PathwayNumber,
PathwayNumber as PathwayTemp
FROM inputpathway\RTTEPIPERIOD.qvd] (qvd);

table2:

LOAD InternalPatientNumber as INTERNALPATIENTNUMBER
,
EpisodeNumber as EPISODENUMBER
,
PathwayNumber & '|' & PPeriodId as PNkey
,
PathwayNumber
FROM [ inputpathway\RTTEPIPERIOD2.qvd] (qvd)
Where not exists(PathwayTemp,PathwayNumber);

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Not applicable

Re: Where not exists removes all records

It looks like RTTEPIPERIOD2.qvd does not contain any records with PathwayNumber values that do not exist in RTTEPIPERIOD.qvd


talk is cheap, supply exceeds demand
2 Replies
Gysbert_Wassenaar
Not applicable

Re: Where not exists removes all records

It looks like RTTEPIPERIOD2.qvd does not contain any records with PathwayNumber values that do not exist in RTTEPIPERIOD.qvd


talk is cheap, supply exceeds demand
steveniow
Not applicable

Re: Where not exists removes all records

thank you.

it wasn't quite that - I had checked - but in going back I spotted other bits!

still my own stupidity though!