Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Data modeling - customer seniority

Hello!

I need an ideea.

 

I have a tabular model made up of tables of the dimensions and facts type. Customers find themselves in a slowly changing dimension.

I need to add the customer's seniority. How could I model this?

A customer can be active in different periods.

At this moment I have a table that contains the client, the account opening date and the account closing date:

CUSTOMER_ID OPEN_DATECLOSE_DATE
1234561/1/20221/6/2022
1234561/12/2022NULL


The client dimension looks like this:

DIM_CUSTOMER_IDCUSTOMER_IDCUSTOMER_NAMEDATE_FROMDATE_TO
100123456ANA1/1/2022NULL

where date_from and date_to represent from when until when the record from DIM_CUSTOMERS is valid.

HOW CAN I MODEL THE DATA SO THAT I CAN BUILD A FACT TYPE TABLE WHERE I CAN FIND HOW MANY MONTHS OLD THE CLIENT IS ACTIVE ?

1 Reply

  • How do you define active?  Open Date past Close Date, or do you have an actual transaction date of sorts?