# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save \$300 before February 6: REGISTER NOW!
cancel
Showing results for
Did you mean:
Contributor III

## Dimension of a variable as value to another Variable

Hello,

I am creating a kind of lookup table where a person will enter Employee Name and the table should show total salary of his department and company also. Here is an example data and what i wanted to see.

Tables i have in qlik sense:  These two are totally independent tables

(complicated to explain y they are independent, not a big deal for now)

 TABLE 1 EMP_NAME DEPARTMENT Thi year SALARY ABC IT 500 DEF DB 600 GHI IT 400 JKL IT 100 MNO HR 500

 TABLE 2 DEPARTMENT_2 NEXT YEAR REV IT 1200 DB 900 HR 1000

- Now in a sheet, i have a variable to enter Emp name. i will enter ABC in the variable.

- I would like to get the following data as result:

 Emp Name Emp Total Department Department Total (This Year) Dept Next Year Total Company Total ABC 500 IT 1000 1200 2100

I am having difficulty in achieving the final 3 columns.

3rd col : Dept Total - here Dept will vary based on what EMployee i am searching for.

4th col : Dept Next year : as this is independent table - i should give variable as DEPARTMENT_2 = {ABC's DEPARTMENT from Table 1}.. something like this

5th col: irrespective of my Employee name search, should always display total company wide numbers.

Labels (3)

• ### variable of a variable

MVP

Dept Total:

sum(total {<
DEPARTMENT= P({<EMP_NAME = {"\$(=vEmployee)"}>}) >} [Thi year SALARY])

Dept Nex Year Total:

sum({<
EMP_NAME = {"\$(=vEmployee)"},
DEPARTMENT_2= P({<EMP_NAME = {"\$(=vEmployee)"}>}DEPARTMENT) >} [NEXT YEAR REV])

Company Total:

sum(total [Thi year SALARY])

Spoiler

[TABLE 1]:
EMP_NAME, DEPARTMENT, Thi year SALARY
ABC, IT, 500
DEF, DB, 600
GHI, IT, 400
JKL, IT, 100
MNO, HR, 500];

[TABLE 2]: