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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ID's in two tables names

Hi All,

i have two tables, one is person

person:

LOAD PersonID,

     PersonCode,

     PersonName

from ........................

second one is sales

sales:

LOAD

Date,  

     ZMID,

     RMID,

     BMID,

     MEID,

     netsales

from ...................

Now i want PersonName for ZMID, RMID. BMID and MEID in sales table where PersonID=ZMID as ZMPersonName, PersonID=RMID as RmPersonName, PersonID=BMID as BMPersonName and PersonID=MEID as MEPersonName,

How we can do in qlikview i tried with applymap but its not working..which function we will use in QV.

thanks in advance...

Rg,

baru..

3 Replies
jvishnuram
Partner - Creator III
Partner - Creator III

Hi Baru,

You can achieve this by making the crosstable() function like this.,

T1:

LOAD * INLINE [

    Person_ID, Person_Name, Person_Code

         ZMID, A, 1

         RMID, B, 2

         BMID, C, 3

         MEID, D, 4

];

S1:

LOAD * INLINE [

    Date, netsales,ZMID,RMID,BMID,MEID

    1/2/2013, 100

    1/3/2013, 200

    1/4/2013, 300

    1/5/2013, 400

    1/6/2013, 500

];

S2:

CrossTable(Person_ID,Value,2)

Load * Resident S1;

   

Drop Table S1;

VJ
sujeetsingh
Master III
Master III

See this sample .

Hope it helps you.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I would do it like this:

MapPerson:

Mapping LOAD PersonID,

     PersonName

from ........................

second one is sales

sales:

LOAD

Date, 

    ZMID,

    ApplyMap('MapPerson', ZMID, 'UNKNOWN') As ZMPersonName,

    RMID,

    ApplyMap('MapPerson', RMID, 'UNKNOWN') As RMPersonName,

    BMID,

    ApplyMap('MapPerson', BMID, 'UNKNOWN') As BMPersonName,

    MEID,

    ApplyMap('MapPerson', MEID, 'UNKNOWN') As MEPersonName,

    netsales

from ...................

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein