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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Alex
Contributor II
Contributor II

join two tables using a dynamic key

Hi all,

I would like to join two tables (A and B) with the following structure:

A:
X, Y, Z

B: 
X, Y, Z, P

The point is that X, Y or Z value is '*' in table B what means "all possible values".
In case X would be '*' I would like to join to A using only Y and Z.

How can I do that? I know in SQL, for instance, you can use functions like isnull(X,'*') so you're kind of ignoring some columns once joining.

Thanks in advance.

4 Replies
vishsaggi
Champion III
Champion III

Can you share some sample data with your expected output please.? Not clear what exactly you are trying to do. You can use ISNULL() in QV too.
Alex
Contributor II
Contributor II
Author

Example:
(Table A):
X, Y, Z
M, UK, L

(Table B):
X, Y, Z,W
M,*,*,1
M,N,*,2

 I would like to do an applymap on table A using as a Key "X & Y & Z" to get W column from B.
However, table B contains '*' sometimes which means "all values". In this case, I would like to ignore the columns where I have '*' and only use as a Key the rest.

In the example posted, only X would be my key for the first row.
X&Y would be the key for the second row, etc.

vishsaggi
Champion III
Champion III

What is your expected output?

marcus_sommer

One way might be to use multiple joinings each one with the appropriate fields and where-statements. But before I would check: Mapping-as-an-Alternative-to-Joining

 

- Marcus