Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to join Sales with clients from 2 databases

Hello Everyone! I need your support. I Have the table sales which is made from two different database.

I need to link sales with clients, but I have 2 clients tables , one for each database.

How is the best way to do it ?

I attached the excel example

thank you in advance!

5 Replies
martinpohl
Partner - Master
Partner - Master

find an example attached

Regards

TKendrick20
Partner - Specialist
Partner - Specialist

Looks like you're in need of concatenation.

Concatenation is possible in two ways accounting for whether both of your Clients tables have exactly the same fields.

Here is a resource with some examples: Concatenate Tables Qlik Sense 3.1

vinieme12
Champion III
Champion III

<<Modified Script>>

ClientS:

ClientID as CommonClientID,

Client Name

FROM TANGO;

Concatenate

ClientID &'_'&ClientOfficeID as CommonClientID,

Client Name

FROM Totvs;

Sales:

Load

ClientID &if(ClientOfficeID = 0  or isnull(ClientOfficeID ) ,'','_'&ClientOfficeID ) as CommonClientID

otherfields

FROM Sales;

LEFT JOIN(Sales)

LOAD * RESIDENT ClientS;

Drop table ClientS;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
martinpohl
Partner - Master
Partner - Master

Vineeth,

this solution won't work!

while using the second join Statement there are two fields that are existing in Sales tab:

TotvsID AND Client Name (resulting from the first join).

So no dataset will be joined!

Be careful with joining, often it isn't neccessary. Think in tables and linked fields.

Regards

vinieme12
Champion III
Champion III

you are right, no need to join

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.