Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exsists function

Hello everyone,

In my load data model i had a fact and two dimension tables, one for Customer and other of Ok_Customer. Both of these have customer ID in them.

I use to load

Fact:

Customer_Key

Ok_Customer_Key

Metrics

Dim1:

Customer_key

other details

where exists(Customer_key)

Dim2:

Ok_Customer_Key

other details

where exists(Ok_Customer_key)


Now i want to combine dim1 and dim2 . So how can i use exists function?

15 Replies
Chanty4u
MVP
MVP

Hi,

What are the values for  Customerkey and OK cust key?

Not applicable
Author

Does it matter?

These are unique keys associated to customers and Ok_customers.

Anonymous
Not applicable
Author

what do you mean Combine? concatenate, join?

concatenate (Dim1)

load

Ok_Customer_Key

other details

where exists(Customer_key,Ok_Customer_key)

join automatically only joins same records

left join(Dim1)

load

Ok_Customer_Key as Customer_Key

Ok_Customer_Key

other Details

resident Dim2

Not applicable
Author

Sorry forgot to mention.

Combine means

Dim1:

Customer_key

other details

Join

Dim2:

Ok_Customer_Key

other details


Not applicable
Author

i m doing full outer join

Anonymous
Not applicable
Author

this should do (Keep origin OK_Customer_Key, so you can identify those records coming from Dim2)

left join(Dim1)

load

Ok_Customer_Key as Customer_Key

Ok_Customer_Key

ther Details

resident Dim2

above script will only load those records from Dim2 which exists (Customer_Key)

Not applicable
Author

what if  i just want to load

Dim1

join

Dim2

where

exsists (Customer_Key,Ok_Customer_Key)

Will the above work correctly?

Anonymous
Not applicable
Author

at least you need an identical field, without you would create a cartesian product

but the where condition is obsolete as you only want the records joined where Ok_Customer_Key exists as Customer_Key

so your Syntax would look like

left join(Dim1)

load

Ok_Customer_Key as Customer_Key

Ok_Customer_Key

other Details

resident Dim2

where exists(Customer_Key, OK_Customer_Key)

-> Where condition is not neccessary!

Not applicable
Author

I have an identical field already have customer_cd which is present in both the tables.