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: 
user-azadi
Contributor III
Contributor III

exists condition

hello every body

i have  two table :

Table1:

LOAD * INLINE [

    ID, Num1

    16110001, 382500

    16110005, 400000

    16110006, 230000

];

Table2:

LOAD * INLINE [

    ID, Num2

    16110001, 43000

    16110002, 50000

    16110003, 24000

    16110004, 18000

]

Where not Exists (ID);

result is :

IDNum2
1611000250000
1611000324000
1611000418000

but i want add other condition in where syntax ; so that i check Num1 = Num2 also

i wrote:

Table2:

LOAD * INLINE [

    ID, Num2

    16110001, 43000

    16110002, 50000

    16110003, 24000

    16110004, 18000

]

Where not Exists (ID) and (Num1=Num2);


but send error . what can i do for resolve it?


Regards ...



1 Solution

Accepted Solutions
user-azadi
Contributor III
Contributor III
Author

Dear Prashant

My expectation from result is :

ID Num2
1611000143000
1611000250000
1611000324000
1611000418000

because in my condition (         Where not Exists (ID) and (Num1=Num2)      )

1. not exists(ID)

2. Num1=Num2


ID 16110001 is common field in Table1 and Table2 and should not come to result

but when we have Num1=Num2 ; so we have ID 16110001 too in result.

View solution in original post

4 Replies
PrashantSangle

You cant in this case join both table then use Num1=num2

Table1:

LOAD * INLINE [

    ID, Num1

    16110001, 382500

    16110005, 400000

    16110006, 230000

];

Join

LOAD * INLINE [

    ID, Num2

    16110001, 43000

    16110002, 50000

    16110003, 24000

    16110004, 18000

]

Where not Exists (ID);

NoConcatenate

Final:

Load * From Table1

where Num1=Num2;


Drop table Table1;


Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Mohammad,

Use below code may be it will help you:

Table1:

LOAD * INLINE [

    ID1, Num1

    16110001, 382500

    16110005, 400000

    16110006, 230000

];

Table2:

LOAD * INLINE [

    ID, Num2

    16110001, 43000

    16110002, 50000

    16110003, 24000

    16110004, 18000

    16110004, 18000

]

Where not Exists (ID1,ID);




Op: will be

IDNum2
1611000250000
1611000324000
1611000418000

More help please find app.

Thanks,

Arvind patil

antoniotiman
Master III
Master III

I Think this doesn't make sense.

ID result  don't have Num1 because they "not Exists" in Table1.

user-azadi
Contributor III
Contributor III
Author

Dear Prashant

My expectation from result is :

ID Num2
1611000143000
1611000250000
1611000324000
1611000418000

because in my condition (         Where not Exists (ID) and (Num1=Num2)      )

1. not exists(ID)

2. Num1=Num2


ID 16110001 is common field in Table1 and Table2 and should not come to result

but when we have Num1=Num2 ; so we have ID 16110001 too in result.