Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

How to apply condition to Left Join?

Hi, All

How to make left join with condition?

for example, i can write in PL/SQL

select Table1.ProductID, value1.Table1, value2.Table2

from Table1

left join Table2 on (Table1.ProductID=Table2.ProductID and value2.Table2 < value1.Table1)

how to make something of the kind in QlikView? i.e. how to apply condition value2.Table2 < value1.Table1 to left join in QlikView?

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: How to apply condition to Left Join?

Hi,

following Israrhan answer, something like this:

Table1:

LOAD * INLINE [

    ProdID, value1

    1, 12

    2, 10

    3, 8

    4, 6]

    ;

Table2:

LOAD * INLINE [

    ProdID, value2

    1, 13

    2, 9

    3, 7

    5, 1]

    ;

Left join (Table1)

Load ProdID,

    value2

resident Table2

;

Drop table Table2;

Table:

Load ProdID,

    value1,

    if(value1>value2, value2) as value2,

    1

resident Table1

;

Drop table Table1;

View solution in original post

4 Replies
Highlighted
Specialist II
Specialist II

Re: How to apply condition to Left Join?

use applymap

Highlighted
Specialist II
Specialist II

Re: How to apply condition to Left Join?

Hi Ivan,

i think its hard to convert into qlikview, but i think...

1) first you should read data on left join, you will get one table right, without condition value2.Table2 < value1.Table1, mean you will have whole data, in table1.

2) then load the data again in RESIDENT LOAD from (Table1), and apply the condition, you will get a new table.

3) then DROP the previous table(table1).

give a try to it,,,it might help..

Highlighted
Partner
Partner

Re: How to apply condition to Left Join?

Hi,

following Israrhan answer, something like this:

Table1:

LOAD * INLINE [

    ProdID, value1

    1, 12

    2, 10

    3, 8

    4, 6]

    ;

Table2:

LOAD * INLINE [

    ProdID, value2

    1, 13

    2, 9

    3, 7

    5, 1]

    ;

Left join (Table1)

Load ProdID,

    value2

resident Table2

;

Drop table Table2;

Table:

Load ProdID,

    value1,

    if(value1>value2, value2) as value2,

    1

resident Table1

;

Drop table Table1;

View solution in original post

Highlighted
Not applicable

Re: How to apply condition to Left Join?

Thank you, it works fine