Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

kumarreddy257
Not applicable

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
Not applicable

Re: Joining with two key columns

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;

5 Replies
malini_qlikview
Not applicable

Re: Joining with two key columns

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;

maxgro
Not applicable

Re: Joining with two key columns

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;

Arjunarao
Not applicable

Re: Joining with two key columns

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
Not applicable

Re: Joining with two key columns

Hi All,

Thanks a lot. It helps me a lot.

Regards,

Kumar

Arjunarao
Not applicable

Re: Joining with two key columns

HI Reddy,

GLad to be a part of the answer