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

Match values between two tables

Hi all.

I have two data sets, each with a list of users.

The first data file is loaded in, and has like 100 users.

The second is loaded in, and has 50 users.

lists.png

If a user is on both sets, I want to create a new field called UserType and call those users 'B'. If they are only on the original list, then 'A'.

Any ideas?

I've done some research and am thinking to use the exists() command but am not sure how to implement this fully.

Thanks

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Check this?

Sample taken from QV Help Reference.

Employees:

LOAD * inline [

Employee|ID|Salary

Bill|001|20000

John|002|30000

Steve|003|35000

] (delimiter is '|');

Citizens:

Load * inline [

Name|Address

Bill|New York

Mary|London

Steve|Chicago

Lucy|Paris

John|Miami

] (delimiter is '|');

EmployeeAddresses:

Load Name as Employee, Address,

     IF(Exists(Employee, Name), 'B', 'A') AS GroupType

Resident Citizens;

Drop Tables Employees, Citizens;

View solution in original post

2 Replies
vishsaggi
Champion III
Champion III

Check this?

Sample taken from QV Help Reference.

Employees:

LOAD * inline [

Employee|ID|Salary

Bill|001|20000

John|002|30000

Steve|003|35000

] (delimiter is '|');

Citizens:

Load * inline [

Name|Address

Bill|New York

Mary|London

Steve|Chicago

Lucy|Paris

John|Miami

] (delimiter is '|');

EmployeeAddresses:

Load Name as Employee, Address,

     IF(Exists(Employee, Name), 'B', 'A') AS GroupType

Resident Citizens;

Drop Tables Employees, Citizens;

Not applicable
Author

Thanks!