Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
david3292
New Contributor

Join Problem

Hello all

I have this tables

tabla a.PNG

table b.PNG

I need a result table that compares these two tables and results in the following table record

result.PNG

I was trying to do it with joins, but my knowledge is not very broad, so I ask any colleague with more experience and knowledge, help me to solve this problem.

Hope for your help.

Best regards.

1 Solution

Accepted Solutions
cristianozilz
New Contributor III

Re: Join Problem

Hi,

You'll create a concatenate key for these fields.

Table1:

Load

     *,

     CodMaterial_1 & ' |' & Centro_1 & ' |' & AnoMes   as pk 

From Table1

Table2:

Load

     *,

     CodMaterial & ' |' & Centro & ' |' & AnoMes   as pk 

From Table2

6 Replies
cristianozilz
New Contributor III

Re: Join Problem

You need use "where Not Exists"

qliktech_uk
New Contributor III

Re: Join Problem

Are you looking at Centro_1 / Cantidad /Valor to drive your result?

eduardo_dimperi
Valued Contributor II

Re: Join Problem

Hi David, Like Cristiano said, you can use the concept of Exists or Not Exists, but this only if the data have not be loaded in the memory yet.

Cause the Exists will check not if result of Table A not exists on Table B, but in all tables already loaded.

david3292
New Contributor

Re: Join Problem

Hi Cristiano

Thanks for your help, but I need to compare based on the three fields, CodMaterial, Center, YearMes, in table A these fields are with _1, but they are the same. The exits function does not allow me to compare these three fields, how could this be solved?

Best Regards

cristianozilz
New Contributor III

Re: Join Problem

Hi,

You'll create a concatenate key for these fields.

Table1:

Load

     *,

     CodMaterial_1 & ' |' & Centro_1 & ' |' & AnoMes   as pk 

From Table1

Table2:

Load

     *,

     CodMaterial & ' |' & Centro & ' |' & AnoMes   as pk 

From Table2

david3292
New Contributor

Re: Join Problem

Thanks for your help, I created a PK field with the function AutoNumberHash128

Community Browser