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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Lookup, ApplyMap, Joins - Need Help

Table A
Ticket NoCustomer Name
123Shankar
121Arun
31231Vijay
34535Sandy
3534James

  

Table B
CustomerCity
ShankarChennai
ArunMadurai
VijaySingapore
SandyBelgium
JamesUSA

I want to map the city in Table B to the Customer Names in Table A.

1. I have tried renaming the Customer in Table B as Customer Name to create a sync but the result is not accurate.

Is there a way to create a lookup or applymap or any better solution? Please suggest.

35 Replies
Anonymous
Not applicable
Author

I have tried but getting blank.

Anonymous
Not applicable
Author

Below script will give you correct result. Just try and let me know your result

TableA:

LOAD [Ticket No],

     [Customer Name] as Customer

FROM

(ooxml, embedded labels, table is Sheet1);

left join (TableA)

TableB:

LOAD Customer,

     City

FROM

(ooxml, embedded labels, table is Sheet1);

Anonymous
Not applicable
Author

Capture.PNGHi Friends,

The actual problem is attached.

When I joined the 2 tables I am getting the City, Count of Tickets and the same ticket number is appearing without city.

So the count is getting doubled in my result.

Please see attached.

Anonymous
Not applicable
Author

Hi,

The actual problem is attached.

When I joined the 2 tables I am getting the City, Count of Tickets and the same ticket number is appearing without city.

So the count is getting doubled in my result.

Please see attached.

Capture.PNG

Anonymous
Not applicable
Author

have you tried left join ??

Anonymous
Not applicable
Author

also can you attached your QVW

MayilVahanan

Hi Vijay,

Try like this

//Solution 1

Directory;

LOAD [Ticket No],

     [Customer Name]

FROM

[Table A.xlsx]

(ooxml, embedded labels, table is Sheet1);

Left Join

LOAD Customer as [Customer Name],

     City

FROM

[Table B.xlsx]

(ooxml, embedded labels, table is Sheet1);

//Solution 2

Map:

Mapping

LOAD Customer,

     City

FROM

[Table B.xlsx]

(ooxml, embedded labels, table is Sheet1);

NoConcatenate

LOAD [Ticket No] as TicketNo,

     [Customer Name] As CustomerName,

     ApplyMap('Map',[Customer Name], 'NA') AS CityMap

FROM

[Table A.xlsx]

(ooxml, embedded labels, table is Sheet1);

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

The solution worked just by renaming Customer Name and without joins.

But This is just a sample data.

My real data is I am having DB with IT tickets and customer name. I am querying AD to get the user list with their city names. Then when map both table (Ticket Table and AD table) by renaming like customers as you advised. It is working fine. But for some users I dont have city name filled out in AD. So I getting a data like attached. For Example: St Neots I have 2 tickets. Bit the same ticket number is coming up also in the list of blank city names. When I tried this using a flat file excel (the same amount of data (1000 tickets) I have no issues. But when joining as tables I am getting the below issues. I dont know why IN98301 is coming in St Neots as well as in the blank City tickets.

I am breaking my head

Capture.PNG

Colin-Albert
Partner - Champion
Partner - Champion

This will not work for two reasons:

Firstly the mapping table must be loaded before it is used in an applymap statement.

Secondly if you are using an apply map to bring the relecant City into table A based on the Customer Name, then you should not use a left join as well.


Colin-Albert
Partner - Champion
Partner - Champion

Hi Vijay,

Have a look at this blog which explains the advantages of using ApplyMap instead of Joins.

Don't join - use Applymap instead