Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, i need some help joining 2 fields from different tables.
My tables are as follows
LOAD
StoreNumber,
TransId,
EmployeeId
FROM
C:\QLIKVIEW\Transaction.csv
LOAD
StoreNumber,
EmployeeName
FROM
C:\QLIKVIEW\Employee.csv
I want to create a new field called STOREEMPLOYEE from EmployeeId (from the first table) and EmployeeName (From the second table)
Can anyone tell me how to do thsi please?
Assuming StoreNumber is the key between these two tables.
EMPTRN:
LOAD
StoreNumber,
TransId,
EmployeeId
FROM
C:\QLIKVIEW\Transaction.csv;
Left join
LOAD
StoreNumber,
EmployeeName
FROM
C:\QLIKVIEW\Employee.csv;
EmpFinal:
Load *,
EmployeeId & EmployeeName as STOREEMPLOYEE
resident EMPTRN;
drop table EMPTRN;
Hi
Is what you want even possible?
For any given storenumber, how will you know which EmployeeName relates to which EmployeeID? (Unless there is never more than one employee per StoreNumber)
Jonathan
Hi, this will not work as i need to keep the both tables as they have more fields that i require in my script. What i have included in my original post is only a portion of it. There are about 25 fields in the table.
These 2 tables are not linked directly
Two separate tables might work - that does not imply that you can combine them into one.
You need to have some way of determining which EmployeeID maps to which EmployeeName - although I did not see an EmployeeID on the model.
One way to test this is to have a sheet showing 3 listboxes: StoreNumber, EmployeeID and EmployeeNumber. Play around withe selections on that and you'll see what I mean. I expect that if you select an employeeID, you'll see more than one name.
I am assuming that there is not some sort of denormalisation in your datasource, or in your load script.
Jonathan
Thanks Jonathan, The employeeId is within the POSTransactionHeader, The table image i attached is limited, there are 20+ fields within most of the tables.
An employee name and ID are linked to a store number, So before the end user selects an employee they will first select a store number which then only displays employees relevant to that store.
Okay, maybe the example in the initial post misled me. But I see no problem here, or do you need some guidance on the syntax of joining tables?
Yes please if you don't mind. Maybe i should have explained it in my initial post a bit better! 🙂
I know how to join fields within the same table, But i have never done it for fields from different tables.
Here is my QVW
I want to link
EmployeeId From POSTransactionHeader with
EmployeeName From StoreEmployee
Your help is very appreciated!