Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
rittermd
Master
Master

Script Help

I don't know if this is possible or even makes sense to do.

But here goes.

I want to create one table that contains all terminated employees and a second table that contains all active employees.  I have done that so far.

Now the part I am not sure of.

I want to create a third table that contains all of the terminated employees and only the active employees where there is no matching employee id in the terminated table.

So far I have something like this:

LoadTerms:

Load Distinct Employee_ID

From QVD where currentactive='0'

LoadActive:

NoConcatenate

Load Distinct Employee_ID

From QVD where currentactive='1'

Next I want to combine them into a third table as I detailed above.

Not sure how to do that.

3 Replies
Anonymous
Not applicable

Technically, you can do this:

ThirdTable:

LOAD DISTINCT

     Employee_ID,

     Employee_ID as Term_ID

RESIDENT LoadTerms;

CONCATENATE (ThirdTable) LOAD DISTINCT

     Employee_ID

RESIDENT LoadActive

WHERE not exists(Term_ID, Employee_ID);

DROP FIELD Term_ID;

Logically - is it possible that the same Employee ID is both active and terminated???

rittermd
Master
Master
Author

That is the problem.  The way the data is being delivered I have multiple rows for the same employee and in my final table I need to make sure that I don't have an active record with a termed record.

maxgro
MVP
MVP

something like this?

see the attachment

1.png