Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
deepakqlikview_123
Specialist
Specialist

Exist function

Hi All,

Can you please suggest, how below expression will work,

1. if(EXISTS(INNETWORK_PHYSICIAN_ID, ROWID_OBJECT), 'IN', 'OUT') as [Physician In/Out Network],

2.WHERE EXISTS(%PHYSICIAN_ID, ROWID_OBJECT)



Thanks,

Deepak

1 Solution

Accepted Solutions
its_anandrjs

In second expression

Tab1:

load * inline [

%PHYSICIAN_ID

a

b

c

d

e

f

];

Tab2:

load

inline [

ROWID_OBJECT

a

b

c

d

] WHERE EXISTS(%PHYSICIAN_ID, ROWID_OBJECT);

result will be only common records

result.png

Regards

Anand

View solution in original post

3 Replies
its_anandrjs

Hi,

1. In first expression

    if(EXISTS(INNETWORK_PHYSICIAN_ID, ROWID_OBJECT), 'IN', 'OUT') as [Physician In/Out Network],

if value match in this two fields then the IN value field in [Physician In/Out Network] otherwise OUT.


2. In Second expression

WHERE EXISTS(%PHYSICIAN_ID, ROWID_OBJECT)


When data match in this two fields %PHYSICIAN_ID, ROWID_OBJECT then data loads in the table


Regards

Anand


maxgro
MVP
MVP

exists (INNETWORK_PHYSICIAN_ID, ROWID_OBJECT)

returns -1 (true) if the value of ROWID_OBJECT is found in the current content of the field INNETWORK_PHYSICIAN_ID

table1:

load * inline [

INNETWORK_PHYSICIAN_ID

a

b

c

];

table2:

load

  *,

  if(EXISTS(INNETWORK_PHYSICIAN_ID, ROWID_OBJECT), 'IN', 'OUT') as [Physician In/Out Network]

inline [

ROWID_OBJECT

a

b

c

d

];

1.png

2) using WHERE EXISTS(INNETWORK_PHYSICIAN_ID, ROWID_OBJECT) in my example you only get

a

b

c

you load ROWID_OBJECT if the same value already exists in INNETWORK_PHYSICIAN_ID field

its_anandrjs

In second expression

Tab1:

load * inline [

%PHYSICIAN_ID

a

b

c

d

e

f

];

Tab2:

load

inline [

ROWID_OBJECT

a

b

c

d

] WHERE EXISTS(%PHYSICIAN_ID, ROWID_OBJECT);

result will be only common records

result.png

Regards

Anand