Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
qv_testing
Specialist II
Specialist II

Map field to other table

Hi Community,

I want to map field one table to another table.

please look at here..

Suppose i have 2 tables..

Table1:

CostCentreAccountClientCodeAmountYear
511017011036600112452014
1915110311ABCD10002014
1915110711ABCD122014
1915110311ABCD1232014
1915110311ABCD452014
1915110311ABCD802014
1915110711ABCD302014

Table2:

CostCentreClientCodeTypeAmountyear
5110366001WIP IN12452014
1915ABCDWIP OUT10002014
1915ABCDNotes122014
1915ABCDABC1232014
1915ABCDSUMAC02014
1915ABCDWIP IN892014

1915

ABCD

WIP OUT

9

2014

1916ABVFABVH192014

These are my 2 tables, Table1 is main data, Table2 is also almost same,

but Amount different.

Here i have to map Type field to Table1, i don't bother about Amount in second table.

I want to Table1 Amount  only.

Note: Only i have to Map Type field to Table1.

My Output should be, If i am take

Dimension: Type

Expression: Sum({<Year={'2014'}>}Amount)

 

Type2014
WIP IN1325
WIP OUT1030
Notes12
ABC123
SUMAC45

Hope you Understand....

Thanks in Advance..

14 Replies
Kushal_Chawda

Simply link you tables by creating Key like this

Table1:

LOAD ID,

           autonumber(Client&Category&Amount) as Key

          Client,

          Category,

          Product,

          Amount

FROM table1;

Table2:

LOAD autonumber(Client&Category&Amount) as Key,

          Order

FROM table2;

avinashelite

if you have multiple mapping values like 

IDClientCategoryProductAmount
1AC001Poker PaulNokia1290
2AC001Poker PaulNokia-1290

Don't go with the Mapping function simple create a common key field between tables

Table1:

LOAD ID,

           Client&'-'&Category&'-'&Amount as Key

          Client,

          Category,

          Product,

          Amount

FROM table1;

Table2:

LOAD Client&'-'&Category&'-'&Amount as Key,

          Order

FROM table2;

qv_testing
Specialist II
Specialist II
Author

HI Kaushal/Avinash,

please look at here..

Suppose i have 2 tables..

Table1:

CostCentreAccountClientCodeAmountYear
511017011036600112452014
1915110311ABCD10002014
1915110711ABCD122014
1915110311ABCD1232014
1915110311ABCD452014
1915110311ABCD802014
1915110711ABCD302014

Table2:

  

CostCentreAccountClientCodeTypeAmountyear
5110170110366001WIP IN12452014
1915110311ABCDWIP OUT10002014
1915110711ABCDNotes122014
1915110311ABCDABC1232014
1915110311ABCDSUMAC02014
1915110311ABCDWIP IN892014
1915110711ABCDWIP OUT92014

These are my 2 tables, Table1 is main data, Table2 is also almost same,

but Amount different.

Here i have to map Type field to Table1, i don't bother about Amount in second table.

I want to Table1 Amount  only.

Note: Only i have to Map Type field to Table1.

My Output should be, If i am take

Dimension: Type

Expression: Sum({<Year={'2014'}>}Amount)

  

Type2014
WIP IN1325
WIP OUT1030
Notes12
ABC123
SUMAC45

Hope you Understand....

Thanks in Advance..

qv_testing
Specialist II
Specialist II
Author

Please guys have a look above post...

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

map_type:

mapping LOAD autonumber(CostCentre & ClientCode & Amount & year),

     Type

FROM

(ooxml, embedded labels, table is Sheet2);

Master:

LOAD CostCentre,

     Account,

     ClientCode,

     Amount,

     Year,

     ApplyMap('map_type', autonumber(CostCentre & ClientCode & Amount & Year), ':') as Type

FROM

(ooxml, embedded labels, table is Sheet1);

The outcome would be like this:

Screenshot_2.png

Take a look at the attachment.

qv_testing
Specialist II
Specialist II
Author

But here i don't have Amount same in 2 tables.

I want to fetch from Amount Table1.

My Output should be

Dimension: Type

Expression: Sum({<Year={'2014'}>}Amount)

 

Type2014
WIP IN1325
WIP OUT1030
Notes12
ABC123
SUMAC45
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Maybe I misunderstood something:

Here i have to map Type field to Table1, i don't bother about Amount in second table.

I want to Table1Amount  only.

What are the conditions again please?

Not applicable

Hi

See the attached,

screen shot.png

qv_testing
Specialist II
Specialist II
Author

in my second table Amount someone entered manually,

So values are not correct.

Only i need to fetch Table1 Amount Only.

i want to compare with Costcentre, CLientCode and Year.

I have to Map Type field to Table1.