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
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