Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikNewbie20
Contributor II
Contributor II

Combining Month and Year fields from two tables

Hi Qlik experts.

I've been really struggling trying to join date fields from two different tables. The month and year are also reported in separate columns. Please advise how to join these two in the load script.

Table 1 Table 2
MarketMonthYearPurchased MarketMonthYearResold
AJan201920 AJan201915
BFeb201925 BFeb201935
CMar201930 CMar201915

 

Thanks

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

little confused. i am assuming 1 table is

MarketMonthYearPurchased

 

and the other  is 

MarketMonthYearResold

 

you can do a simple join between these tables it will consider all columns which are common between the 2 tables and use that for joining

MainTable:
LOAD
    Market,
    "Month",
    "Year",
    Purchased
FROM [lib://Downloads/Community.csv]
(txt, utf8, embedded labels, delimiter is ',', msq);

inner join (MainTable)
LOAD
    Market,
    "Month",
    "Year",
    Resold
FROM [lib://Downloads/Community2.csv]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);

result

Capture.PNG

View solution in original post

2 Replies
dplr-rn
Partner - Master III
Partner - Master III

little confused. i am assuming 1 table is

MarketMonthYearPurchased

 

and the other  is 

MarketMonthYearResold

 

you can do a simple join between these tables it will consider all columns which are common between the 2 tables and use that for joining

MainTable:
LOAD
    Market,
    "Month",
    "Year",
    Purchased
FROM [lib://Downloads/Community.csv]
(txt, utf8, embedded labels, delimiter is ',', msq);

inner join (MainTable)
LOAD
    Market,
    "Month",
    "Year",
    Resold
FROM [lib://Downloads/Community2.csv]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);

result

Capture.PNG

QlikNewbie20
Contributor II
Contributor II
Author

Great. Thanks. Worked like a charm!