Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
ester_pr
New Contributor

Join with if function in script

Hi,

I am trying to create a new field from 3 tables

my script is

Snif:load

Distinct  OvedTokefDeptKey,

SnifDept as SacarDept
,
OVEDSACAR as OVEDid

Resident SACAR;

left join LOAD Distinct [dip] as SacarDept,
    
[sub dip] as snif1
    
Resident Division; left join(Snif)

LOAD MIFAL as snif2
,
OVEDOVED  AS OVEDid

Resident Oved;


LOAD OvedTokefDeptKey,

OVEDid,IF(snif1<>0,snif1,snif2) AS SNIF

Resident Snif;

DROP Table Snif;

is there any oter way?

thanks,

Ester

1 Reply
Not applicable

Join with if function in script

The Below code should work.

Snif:

Load *,
IF(snif1<>0,snif1,snif2) AS SNIF
;

load Distinct
OvedTokefDeptKey,
SnifDept as SacarDept
,OVEDSACAR as OVEDid

Resident SACAR;

left join LOAD Distinct [dip] as SacarDept,
     [sub dip] as snif1
     Resident Division; left join(Snif)

LOAD MIFAL as snif2
,OVEDOVED  AS OVEDid

Resident Oved;

Community Browser