Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

join based on 2 columns in same table in a script

Hi,

I have a table and I want to add column to env=A_A only in case AGREEMENT_A=AGREEMNT_B.

This is not working:

left join(Fact1)
load distinct ticket, approval_project_url as APPROVAL_PROJECT
RESIDENT Fact1

where AGREEMENT_A=AGREEMNT_B;

can you please help.

2 Replies
Highlighted
Champion II
Champion II

Re: join based on 2 columns in same table in a script

if both fields are in the same table then an IF() statement would suffice

LOAD

ticket,

AGREEMENT_A,

AGREEMNT_B,

if(AGREEMENT_A=AGREEMNT_B.,'A_A') as env,

FROM XXXXx;

Highlighted
Luminary
Luminary

Re: join based on 2 columns in same table in a script

Hi Anat,

Qlik makes joins based on common field names, so you do not need to use any where condition, the important thing are names of those fields. So if you for any reason need to make a join a AGREEMENT_A=AGREEMENT_B you should do

tbl1:

LOAD

env,

ticke,

AGREEMENT_A

from source;

left join (tbl1)

LOAD

env,

ticke,

AGREEMENT_B as AGREEMENT_A

from source;

Hope this helps

Juraj