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

Two fields calling another table

Hi,

I have a question.

I have a table "Employes" and a table "Datas".

Like this :

Employes :

KeyUserName
080503Community Qlik !
080504Smiley cool
080505No records

Datas :

DateKeyUserCreateKeyUserModify
13/04/2015080503080504
14/04/2015080503080503
14/04/2015080504080503

I would like this result

DateKeyUserCreate

NameCreate

KeyUserModifyNameModify
13/04/2015080503Community Qlik !080504Smiley cool
14/04/2015080503Community Qlik !080503Community Qlik !
14/04/2015080504Smiley cool080503Community Qlik !

I've tried to create two tables Employes but it doesn't works.

Could you help me?

Thanx

1 Solution

Accepted Solutions
fvelascog72
Partner - Specialist
Partner - Specialist

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

];

View solution in original post

10 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try this:

Load Date, KeyUserCreate, KeyUserModify From Datas;

Left Join

Load KeyUser as KeyUserCreate, Name as NameCreate From Employes;

Let me know

Not applicable
Author

Thanx, but with this code, i have no value for NameModify.

Anonymous
Not applicable
Author

See  attached.  The first table is used a s a map

fvelascog72
Partner - Specialist
Partner - Specialist

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

];

Not applicable
Author

I have an error.

Message is : Field KeyUserCreate not found.

The field KeyUserCreate doesn't exist in mapping table  Employe.

buzzy996
Master II
Master II

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

Not applicable
Author

Thanx,

It's working.

Now, how can i use mapping with 3 fields?

buzzy996
Master II
Master II

u mean u want to add another field?

alexandros17
Partner - Champion III
Partner - Champion III

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;