Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
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
dilipranjith
Partner
Partner

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
dilipranjith
Partner
Partner

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

QlikNewbie20
Contributor II
Contributor II
Author

Great. Thanks. Worked like a charm!