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

Apply one month data to tables with several years monthly data

Hello!

I need a little assistance with my case. I am trying to link 3 tables that contain several matching fields.

As it can be seen two of the tables(Table 1 and Table 2) have 4 common fields and Table 3 has only 2 fields matching with the others, I can link the first two by creating a composite key and inserting all relevant fields data into a link table.

My problem however is that I also need to connect the third table and as it doesn't contain month and year information and make it applicable(important price info) for the whole period of time available(it's the same in table 1 and table2). Could anyone provide any hints?

4 Replies
prma7799
Master III
Master III

Use Master Calendar

Please share some sample data.

sasiparupudi1
Master III
Master III

Table1:

Load

ProductID,

Category,

Year,

Month,

Balance,

from Table1;

left Join(Table1)

Load

ProductID,

Category,

Year,

Month,

Quantity

from Table2;

left Join(Table1)

Load

ProductID,

Category,

Price

from Table3;

hth

Sasi

ChennaiahNallani
Creator III
Creator III

Hi,

Table1:

Load

ProductID&' '&Category&' '&Year&' '&Month as Key,

ProductID&' '&Category as Key1,

ProductID,

Category,

Year,

Month,

Balance,

from Table1;

Table2:

Load

ProductID&' '&Category&' '&Year&' '&Month as Key,

//ProductID,

//Category,

//Year,

//Month,

Quantity

from Table2;

Table3:

Load

ProductID&' '&Category as Key1,

//ProductID,

//Category,

Price

from Table3;

Kushal_Chawda

try this

Table1:

load ProductID & Year & Month as Key1,

Balance

From Table1;

Table2:

load ProductID & Year & Month as Key2,

Quantity

From  Table2;

LinkTable:

load distinct ProductID & Year & Month as Key1,

ProductID,

Year,

Month,

'Table1' as Flag

From Table1;

concatenate

load distinct ProductID & Year & Month as Key2,

ProductID,

Year,

Month,

'Table2' as Flag

From Table2;

Table3:

LOAD ProductID,

Category,

Price

From table3;