Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
anatle1234
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
vinieme12
Champion III
Champion III

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;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
juraj_misina
Luminary Alumni
Luminary Alumni

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