Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a question.
I have a table "Employes" and a table "Datas".
Like this :
Employes :
KeyUser | Name | ||
---|---|---|---|
080503 | Community Qlik ! | ||
080504 | Smiley cool | ||
080505 | No records |
Datas :
Date | KeyUserCreate | KeyUserModify |
---|---|---|
13/04/2015 | 080503 | 080504 |
14/04/2015 | 080503 | 080503 |
14/04/2015 | 080504 | 080503 |
I would like this result
Date | KeyUserCreate | NameCreate | KeyUserModify | NameModify |
---|---|---|---|---|
13/04/2015 | 080503 | Community Qlik ! | 080504 | Smiley cool |
14/04/2015 | 080503 | Community Qlik ! | 080503 | Community Qlik ! |
14/04/2015 | 080504 | Smiley cool | 080503 | Community Qlik ! |
I've tried to create two tables Employes but it doesn't works.
Could you help me?
Thanx
Try this:
Employe:
Mapping LOAD
KeyUser,
Name
INLINE [
KeyUser, Name
080503, Community Qlik !
080504, Smiley cool
080505, No records
];
Datas:
LOAD
*,
ApplyMap('Employe', KeyUserCreate, null()) as "NameCreate",
ApplyMap('Employe', KeyUserModify, null()) as "NameModify"
INLINE [
Date, KeyUserCreate, KeyUserModify
13/04/2015, 080503, 080504
14/04/2015, 080503, 080503
14/04/2015, 080504, 080503
];
Try this:
Load Date, KeyUserCreate, KeyUserModify From Datas;
Left Join
Load KeyUser as KeyUserCreate, Name as NameCreate From Employes;
Let me know
Thanx, but with this code, i have no value for NameModify.
See attached. The first table is used a s a map
Try this:
Employe:
Mapping LOAD
KeyUser,
Name
INLINE [
KeyUser, Name
080503, Community Qlik !
080504, Smiley cool
080505, No records
];
Datas:
LOAD
*,
ApplyMap('Employe', KeyUserCreate, null()) as "NameCreate",
ApplyMap('Employe', KeyUserModify, null()) as "NameModify"
INLINE [
Date, KeyUserCreate, KeyUserModify
13/04/2015, 080503, 080504
14/04/2015, 080503, 080503
14/04/2015, 080504, 080503
];
I have an error.
Message is : Field KeyUserCreate not found.
The field KeyUserCreate doesn't exist in mapping table Employe.
use this,
Employes:
Mapping Load * Inline [
KeyUser, Name
080503, Community Qlik !
080504, Smiley cool
080505 ,No records
];
Datas:
Load * Inline [
Date ,KeyUserCreate, KeyUserModify
13/04/2015, 080503, 080504
14/04/2015, 080503, 080503
14/04/2015, 080504,080503
];
Datas2:
Load
Date,
KeyUserCreate,
KeyUserModify,
ApplyMap('Employes',KeyUserCreate) as NameCreate,
ApplyMap('Employes',KeyUserModify) as NameModify
resident Datas;
drop table Datas;
or pfa
Thanx,
It's working.
Now, how can i use mapping with 3 fields?
u mean u want to add another field?
I did not notice the structure you needed, try this
Employes:
LOAD * Inline [
KeyUser, Name
080503, Community Qlik !
080504, Smiley cool
080505, No records
];
Datas:
LOAD * Inline [
Date, KeyUserCreate, KeyUserModify
13/04/2015, 080503, 080504
14/04/2015, 080503, 080503
14/04/2015, 080504, 080503
];
Final:
NoConcatenate
LOAD Date, KeyUserCreate, KeyUserModify Resident Datas;
Left Join
LOAD KeyUser as KeyUserCreate, Name as NameCreate Resident Employes;
Left Join
LOAD KeyUser as KeyUserModify, Name as NameModify Resident Employes;
DROP Tables Datas, Employes;
If you need other field use this logic:
Left Join
LOAD KeyUser as xxxx, Name as yyyyResident zzzz;