Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
kumarreddy257
Creator
Creator

Joining with two key columns

Hi,

I am new Qlikview

I have a fact table and dimension table. Dim table should join fact table with two key columns.

Like

Fact_fla table is having keys like below

fla_assgn_to_key

fla_assgn_from_key

revenue

fla_status_count

.

.

.

And Dimension table

Dim_con

con_key

.

.

I want to join like

select * from fact_fla,Dim_con

where fla_assgn_to_key=con_key

and fla_assgn_from_key=con_key

Please help me on this scenario.

Regards,

Kumar

1 Solution

Accepted Solutions
malini_qlikview
Creator II
Creator II

You can create a composite key like the below

Fact:

Load

Autonumber(fla_assgn_to_key&fla_assgn_from_key) AS KEY,

fla_assgn_to_key,

fla_assgn_from_key

revenue

fla_status_count

From FACT;

Dim:

Load

Autonumber(con_key&con_key) AS KEY,

con_key

From DIM;

View solution in original post

5 Replies
malini_qlikview
Creator II
Creator II

You can create a composite key like the below

Fact:

Load

Autonumber(fla_assgn_to_key&fla_assgn_from_key) AS KEY,

fla_assgn_to_key,

fla_assgn_from_key

revenue

fla_status_count

From FACT;

Dim:

Load

Autonumber(con_key&con_key) AS KEY,

con_key

From DIM;

View solution in original post

maxgro
MVP
MVP

to join in Qlik just rename (with same name, in bold)  the 2 fields you want to join

FactTable:

load

    fla_assgn_to_key,

    fla_assgn_from_key,

    .....;                        // other fields of fact table

SQL select *

from fact_fla;

join (FactTable)

load

    con_key as fla_assgn_to_key,

    con_key as fla_assgn_from_key,

    ...........; // other fields of dimension table

SQL select *

from Dim_con;

qlikviewwizard
Master II
Master II

Hi,

Please try like this:

Hope this will help you.

Capture.PNG

FactTbale:

Load

Autonumber(fla_assgn_to_key&fla_assgn_from_key) as Key,

fla_assgn_to_key,

fla_assgn_from_key,

revenue,

fla_status_count

From FactTbale;

DimensionTable:

Load

Autonumber(con_key&con_key) AS KEY,

con_key,Dim_con

From DimensionTable;

kumarreddy257
Creator
Creator
Author

Hi All,

Thanks a lot. It helps me a lot.

Regards,

Kumar

qlikviewwizard
Master II
Master II

HI Reddy,

GLad to be a part of the answer