Customer - Account - Service modelling

View previous topic View next topic Go down

Customer - Account - Service modelling

Post  siddesh on Tue Aug 05, 2014 4:42 am

I am new to data modelling. I have a requirement like below

There are 3 dimensions by name Customer, Account and Service. Here One Customer can have multiple accounts, each account can have multiple services. This is for telecom domain.

I have designed a bridge table with Custmer key,Account Key and Service Key, start date and end date.

Can someone suggest on the best approach to model the above case.

Also ETL approach to populate the bridge table.

Awaiting for response.

Thanks in advance - Siddesh

siddesh

Posts : 2
Join date : 2014-08-04

View user profile

Back to top Go down

Re: Customer - Account - Service modelling

Post  nick_white on Wed Aug 13, 2014 7:07 am

Hi,
a dimensional model consists of facts and dimensions, bridge tables are used to solve very specific m:m relationship challenges and would not normally be considered at the start of your design process - as fact tables are the core objects for linking dimensions.

What facts are you trying to model?

Regards,

nick_white

Posts : 366
Join date : 2014-01-06
Location : London

View user profile

Back to top Go down

Re: Customer - Account - Service modelling

Post  siddesh on Wed Aug 13, 2014 7:19 am

Hi,

Thanks for the reply.

I am modeling a case as below for a telecom service provider.

Service number is basically a mobile number which belongs to one account. One account belongs to one customer.
In reverse : One customer can have multiple accounts. One account can have multiple services.

From MSC, we receive call detail records [CDRs] which contains only service number.

Business requirement is to make analysis on the revenue on services, accounts, customers, customer age band etc...

Source for customer, account and service is 3 different tables linked with foreign keys.

Since it is many to one relation, I preferred to make bridge table link customer, account and service to link these dimensions.

Please suggest


Thanks
Siddesh

siddesh

Posts : 2
Join date : 2014-08-04

View user profile

Back to top Go down

Re: Customer - Account - Service modelling

Post  ngalemmo on Wed Aug 13, 2014 12:41 pm

For starters, you need to understand the terminology. As Nick pointed out, a 'bridge table' is a relationship between two dimensions and is used to resolve M:M relationships. In a dimensional model you have fact tables, dimension tables and bridge tables… that is it except in unusual circumstances, of which this is not one of them.

A fact table is zero or more measures surrounded by context (dimensions). Since customer, account and service number are contexts for whatever fact you are trying to record, they should be dimensions of the fact… not a bridge table.
avatar
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

View user profile http://aginity.com

Back to top Go down

RE: Customer - Account - Service modelling

Post  KimballFan on Fri Aug 15, 2014 11:39 am

As I am also modeling for a similar situation (Utility Industry) and was about to ask about the proper way to model the same dimensions, I thought it might be good to tag into this discussion. I hope nobody minds. We are rebuilding our Data warehouse. The original was built about 7 years ago and only got as far as the Customer Data. In the prior model, the Customer, Account and Service Dimensions were created with overlapping information (Service DIm contains info from Customer and Account dims, Account dim contains info from Customer). They are all type 2 SCD's with similar trigger columns so, changes in the Customer info cause new records to be created in all 3 dimensions. In most cases a fact table will only join to 1 of these dimensions. In the new design, I plan to change these dimensions as follows:
1. They do not have overlapping information
2. Do not generate a new record based on changes in one of the other dimensions
3. Whenever possible, have the fact table join to all dimensions at the same level or higher (if a fact is at the service level, it will join to all 3 dims, if it is at the Customer Level, it will only join to the Customer Dim).
I feel pretty confident that these changes are more in line with best practices. Please let me know if I'm missing something. The architect that designed our first DW did a good job for the most part so, if there's justification for keeping it the old way, I will. It just doesn't make sense to me. There's 1 other thing I'm not sure how to handle. The original design also included the surrogate keys for the other dimensions for hierarchies (Service dim had SA Key, Account Key and Customer Key, Account DIm has Account Key and Customer Key). I believe this was done because they are type 2 dimensions and it was the only way to get a primary key for the dimension levels. As I have not seen this in any other Dimensional Model example, I'm wondering if I still need to keep those in the new design. If it helps, we're using OBIEE. Thanks

KimballFan

Posts : 11
Join date : 2014-01-15
Location : Tucson

View user profile

Back to top Go down

Re: Customer - Account - Service modelling

Post  ngalemmo on Fri Aug 15, 2014 12:27 pm

Yes, you are better off keeping customer, account and service distinct and using the appropriate number of FK's depending on the grain of the fact. This allows you to easily aggregate and integrate service level facts with account or customer level facts…. it also cuts down the number of addresses you would have in the service dimension, which can get pretty wide if you include attributes of the dimensions above it.
avatar
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

View user profile http://aginity.com

Back to top Go down

Re: Customer - Account - Service modelling

Post  KimballFan on Fri Aug 15, 2014 12:31 pm

Thanks for the quick response. Do you have any thoughts on the practice of adding the surrogate keys of the other dimensions in the more detailed dimension tables? As I mentioned, I believe this was done in order to have a primary key for the hierarchies - not for snowflaking. I don't know that if it is still necessary and I've never seen it done in any other example

KimballFan

Posts : 11
Join date : 2014-01-15
Location : Tucson

View user profile

Back to top Go down

Re: Customer - Account - Service modelling

Post  ngalemmo on Fri Aug 15, 2014 2:20 pm

There are times when having FK's to other dimensions is handy to support functional aspects of the load processes. Hierarchies are a good example.

They can be used to generate bridge tables or to publish a 'flattened' version of the hierarchy (table or view). It is also useful loading facts when the source does not have all the natural keys. For example a meter read that just has the service number. You want the fact to have the customer and account keys as well, so storing those keys in the service dimension makes the ETL process much simpler as it has an easy way to get them when loading the fact.

You just don't expose those columns thru the end-user BI tool. They are there to support back-end processes.
avatar
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

View user profile http://aginity.com

Back to top Go down

Re: Customer - Account - Service modelling

Post  KimballFan on Fri Aug 15, 2014 2:22 pm

Great! Thanks again for the speedy response. I think I can finally complete my design:)

KimballFan

Posts : 11
Join date : 2014-01-15
Location : Tucson

View user profile

Back to top Go down

Re: Customer - Account - Service modelling

Post  KimballFan on Wed Aug 20, 2014 12:37 pm

OK, I've spent the week finalizing my design. The Service Agreement Dimension is what gave me the most heartburn. It has close to 7,000,000 rows and about 100 attributes. After spending many hours evaluating the attributes for expulsion, the light went on. If I remove the Natural Key (SA ID) from the Dimension and make it an attribute dimension, the table only has about 8,000 rows (distinct set of attributes currently used). I figure I can treat the SA ID as a degenerate dimension and move it to the fact table. For reporting purposes, people just care about the attributes, not the ID. So, am I thinking crazy or am I thinking dimensionally? Are there any pitfalls I'm missing with this approach?

KimballFan

Posts : 11
Join date : 2014-01-15
Location : Tucson

View user profile

Back to top Go down

Re: Customer - Account - Service modelling

Post  nick_white on Thu Aug 21, 2014 7:02 am

Your approach is correct. If the rows in a source system table are effectively just instances of a set of master records you should just be bringing that set of master records into your Dim - and make the BK a hash of the values in the fields in that Dim, so that you can easily match source records with DIm records without having to compare every field value

nick_white

Posts : 366
Join date : 2014-01-06
Location : London

View user profile

Back to top Go down

Re: Customer - Account - Service modelling

Post  KimballFan on Mon Sep 01, 2014 12:16 pm

Thanks for the confirmation Nick. Sorry for the slow reply. I hope this has helped the original poster

KimballFan

Posts : 11
Join date : 2014-01-15
Location : Tucson

View user profile

Back to top Go down

Re: Customer - Account - Service modelling

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum