Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
Hi,
What are the values for Customerkey and OK cust key?
Does it matter?
These are unique keys associated to customers and Ok_customers.
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
Sorry forgot to mention.
Combine means
Dim1:
Customer_key
other details
Join
Dim2:
Ok_Customer_Key
other details
i m doing full outer join
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)
what if i just want to load
Dim1
join
Dim2
where
exsists (Customer_Key,Ok_Customer_Key)
Will the above work correctly?
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!
I have an identical field already have customer_cd which is present in both the tables.