Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
QFanatic
Creator
Creator

Some scripting assistance

Hi all,

I have a set of data - let say its data about employees with key Employee_number. Lets call this data set 1.

Then I want to check if this Employee Number exists in two other data sets - set 2 and 3. It can exists in either, or both.

I have just hit a wall with the scripting of this. The layout I'd like to get is the following.

Employee Number   Exists in data set 1   Exists in Data set 2

abc123                                    Yes                               No

def 789                                    Yes                              Yes

hjk456                                      No                               No

 

How would I achieve this? Keep in mind please that datasets 1 and 2 are huge - about 39 million rows.

Much appreciated.

Labels (1)
1 Solution

Accepted Solutions
abhijitnalekar
Specialist II
Specialist II

Hi @QFanatic ,

 

Please try the below script. Please change the field and table name as per your data.

tempdataset1:
mapping load
employee,
'YES' as value
resident dataset1;

tempdataset2:
mapping load
employee,
'YES' as value
resident dataset2;


tab1:
load
employee,
applymap('tempdataset1',employee,'NO') as 'Exists in data set 1',
applymap('tempdataset2',employee,'NO') as 'Exists in data set 2';

drop Tables tempdataset1,tempdataset2

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

4 Replies
abhijitnalekar
Specialist II
Specialist II

Hi @QFanatic ,

 

Is the Employenumber commonly filed in the three tables?

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
QFanatic
Creator
Creator
Author

Yes the employee number field exists in all three tables.
abhijitnalekar
Specialist II
Specialist II

Hi @QFanatic ,

 

Please try the below script. Please change the field and table name as per your data.

tempdataset1:
mapping load
employee,
'YES' as value
resident dataset1;

tempdataset2:
mapping load
employee,
'YES' as value
resident dataset2;


tab1:
load
employee,
applymap('tempdataset1',employee,'NO') as 'Exists in data set 1',
applymap('tempdataset2',employee,'NO') as 'Exists in data set 2';

drop Tables tempdataset1,tempdataset2

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
QFanatic
Creator
Creator
Author

Thank you very much