Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Best way to join two tables

Hi, everyone.

So, Im trying to make something like this:

In one table, I have this:

TYPEPRODUCTCOLOR
SALE0001BLUE
CHANGE0001BLUE
SALE0002BLACK

And, I need to put the stock in that lines. The problem is, the table of sales have a lot of equals lines, but the table of stock have only a key(product + color) and the number of stock. If I make some join in the table, the lines will repeat and all the table will be wrong. So, Im Trying to solve this with Qlikview(analytics or something like this). Someone can help-me please?

The table of stock is:

KEYSTOCK
0001BLUE1
0002BLUE5
0003BLUE10

Sorry about my english.

3 Replies
sunny_talwar

May be this:

Table:

LOAD TYPE,

          PRODUCT,

          COLOR,

         PRODUCT&COLOR as KEY

FROM Source;

Join(Table)

LOAD KEY,

          STOCK

FROM Source2;

sunny_talwar

Sample for your current data:

Table:

LOAD TYPE,

    PRODUCT,

    COLOR,

    PRODUCT&COLOR as KEY

FROM

[https://community.qlik.com/thread/205976]

(html, codepage is 1252, embedded labels, table is @1);

Join (Table)

LOAD KEY,

    STOCK

FROM

[https://community.qlik.com/thread/205976]

(html, codepage is 1252, embedded labels, table is @2);


Capture.PNG

maxgro
MVP
MVP

you can associate the tables, just add a KEY field in the first one, Prod

1.png

Prod:

LOAD

  TYPE, PRODUCT, COLOR,

  PRODUCT&COLOR as KEY

FROM [https://community.qlik.com/thread/205976] (html, codepage is 1252, embedded labels, table is @1);

Stock:

LOAD

  KEY,

    STOCK

FROM [https://community.qlik.com/thread/205976] (html, codepage is 1252, embedded labels, table is @2);