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.

priyarane
Not applicable

Different columns comparision

hi Community,

Can you please share any thought you have for the below requirement.

I have 2 tables,

1.

Table1:

Dim1,Dimx,Dixy,Join_key;

2.

Dim2,Column1,Colmn2,if(Dim1=Dim2,1,0) as Complex_Key,Join_key;

in the 2nd tab I have two create Complex_Key based on table1,

can you please share your thoughts.

it is not possible to have Exist function.

-Priya

1 Solution

Accepted Solutions
antoniotiman
Not applicable

Re: Different columns comparision

May be like this

LOAD * From Table1;

LOAD *,

If(LookUp('Dim1','Join_Key',Join_Key,'Table1')=Dim2,1,0) as Complex_key

From Table2;

4 Replies
tresesco
Not applicable

Re: Different columns comparision

You can use exist function too I guess. However, to create Complex_Key, you have to load the table for one extra time and that too after the join has already happened. In other words, first join the tables, then create the new field in another load using resident load of the joined table.

priyarane
Not applicable

Re: Different columns comparision

exist will check all the values but here it is '=', so exist cannot be used

tresesco
Not applicable

Re: Different columns comparision

If you want to just create a flag, then exist() won't help. Exist() could help you if you want to discard few values being loaded.

antoniotiman
Not applicable

Re: Different columns comparision

May be like this

LOAD * From Table1;

LOAD *,

If(LookUp('Dim1','Join_Key',Join_Key,'Table1')=Dim2,1,0) as Complex_key

From Table2;