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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Join two tables.

Hi,

How can I join both tables into 1 table, see the script underneath?

Kind regards

[Employees New]:

LOAD *,

  num([Year Salary]/12) as 'Month Salary',

  If( num([Year Salary]/12)<= 1000,'0-1K',

  If( num([Year Salary]/12)>1000 and num([Year Salary]/12)<=2000,'1-2K',

  If( num([Year Salary]/12)>2000 and num([Year Salary]/12) <=3000,'2-3K',

  If( num([Year Salary]/12)>3000 and num([Year Salary]/12)<=4000,'3-4K',

  If( num([Year Salary]/12)>4000,'4K>',''))))) as 'Month Salary Grouped',

  [First Name] & ' ' & [Last Name] as Name

FROM

Datasources\Employees_New.xls

(biff, embedded labels, table is Employee$);

[Employees off]:

LOAD *,

  Age(Today(),[Date of Birth]) as 'Years Old',

  If( Age(Today(),[Date of Birth]) <= 18,'0-18',

  If( Age(Today(),[Date of Birth]) >18 and Age(Today(),[Date of Birth]) <26,'19-25',

  If( Age(Today(),[Date of Birth]) >25 and Age(Today(),[Date of Birth]) <36,'26-35',

  If( Age(Today(),[Date of Birth]) >35 and Age(Today(),[Date of Birth]) <50,'36-49',

  If( Age(Today(),[Date of Birth]) >49,'50+',''))))) as 'Years Old Grouped',

  num([Year Salary]/12) as 'Month Salary',

  If( num([Year Salary]/12)<= 1000,'0-1K',

  If( num([Year Salary]/12)>1000 and num([Year Salary]/12)<=2000,'1-2K',

  If( num([Year Salary]/12)>2000 and num([Year Salary]/12) <=3000,'2-3K',

  If( num([Year Salary]/12)>3000 and num([Year Salary]/12)<=4000,'3-4K',

  If( num([Year Salary]/12)>4000,'4K>',''))))) as 'Month Salary Grouped',

  [First Name] & ' ' & [Last Name] as Name

  FROM

Datasources\EmpOff.xls

(biff, embedded labels, table is Employee$);

4 Replies
sagarkharpude
Creator III
Creator III

use 'concatenate' between this 2 tables as the most of the columns are same

Not applicable
Author

Hi,

Try this script.

[Employees off]:

LOAD *,

  Age(Today(),[Date of Birth]) as 'Years Old',

  If( Age(Today(),[Date of Birth]) <= 18,'0-18',

  If( Age(Today(),[Date of Birth]) >18 and Age(Today(),[Date of Birth]) <26,'19-25',

  If( Age(Today(),[Date of Birth]) >25 and Age(Today(),[Date of Birth]) <36,'26-35',

  If( Age(Today(),[Date of Birth]) >35 and Age(Today(),[Date of Birth]) <50,'36-49',

  If( Age(Today(),[Date of Birth]) >49,'50+',''))))) as 'Years Old Grouped',

  num([Year Salary]/12) as 'Month Salary',

  If( num([Year Salary]/12)<= 1000,'0-1K',

  If( num([Year Salary]/12)>1000 and num([Year Salary]/12)<=2000,'1-2K',

  If( num([Year Salary]/12)>2000 and num([Year Salary]/12) <=3000,'2-3K',

  If( num([Year Salary]/12)>3000 and num([Year Salary]/12)<=4000,'3-4K',

  If( num([Year Salary]/12)>4000,'4K>',''))))) as 'Month Salary Grouped',

  [First Name] & ' ' & [Last Name] as Name

  FROM

Datasources\EmpOff.xls

(biff, embedded labels, table is Employee$);

//[Employees New]:

left join([Employees off])

LOAD *,

  num([Year Salary]/12) as 'Month Salary',

  If( num([Year Salary]/12)<= 1000,'0-1K',

  If( num([Year Salary]/12)>1000 and num([Year Salary]/12)<=2000,'1-2K',

  If( num([Year Salary]/12)>2000 and num([Year Salary]/12) <=3000,'2-3K',

  If( num([Year Salary]/12)>3000 and num([Year Salary]/12)<=4000,'3-4K',

  If( num([Year Salary]/12)>4000,'4K>',''))))) as 'Month Salary Grouped',

  [First Name] & ' ' & [Last Name] as Name

FROM

Datasources\Employees_New.xls

(biff, embedded labels, table is Employee$);

jyothish8807
Master II
Master II

Hi Randy,

What all field are you calling through " * " in both the tables??

Do you have a primary key for both?

Regards

KC

Best Regards,
KC
buzzy996
Master II
Master II

functionally what i understood,u suppose to be add ur all new employees to ur employee off table.

solution: if new employee id is not exists on "employee off " add here.

tht's simple and good solutions i believe.