Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indicators in dimensional tables

Status
Not open for further replies.

frodofr

Programmer
Dec 4, 2008
2
Hi,

On a star model, let assume I have one fact tables with the details of sales and a set of dimension tables (products/clients/stores).
The client table contain some indicators that come directly from the production system.

Now I need to make some queries on the star model and mix the indicators from the client table and from the fact tables :

for example :
select client.client_id,client.ind_client,sales.amount_sales,sales.date_sales
from client, sales
where client.client_id = sales.client_id


The result is that the ind_client indicator is multiplied for each sale record and if I sum this indicator for a set of clients, then the calculation will be wrong.

How can I resolve this issue ? By designing differently the star model or by writing differently the query ?

Many thanks for your answers
 
These are customers indicators like annual income. These indicators are not calculated in the datawarehouse.
 
Typically, you don't aggregate dimension attributes. In this scenario, one would typically create an Income Range attribute. For example:

< $20,000
$20,000 to $40,000
$40,000 to $60,000
etc.
etc.

You can then group on the range.

 
What is the business question you are trying to answer?

Are these indicators slowly changing over time?

In your original question, why would you sum the indicator, but not the amount_sales?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top