sylvain.tacquet (2) [Avatar] Offline
#1
Hello,

I am trying to put in place some measures that do not have the same dimension, and even not the same granularity for a given dimensions.
Simply, on the time dimension, my measure 'montant_charges' has granularity 'Year', whereas the others have 'Day' granularity (which is the granularity of the dimension time table).

However, the SQL computed shows that mondrian joins on the CDE_ANNEE column (e.g the_year in english). So my measure 'montant_charges' is X 365 (normal as CDE_ANNEE is not the PK of my dim table) ! Which is not what I expected and understood from the chapter 5.1.5 of the book.

Am I misunderstanding something or did I make some mistakes ?
Thanks in advance for your help.

Here is the SQL computed :
select
`dim_temps`.`CDE_ANNEE` as `c0`,
sum(`f_charges_magasins`.`montant_charges`) as `m0`
from
`dim_temps` as `dim_temps`,
`f_charges_magasins` as `f_charges_magasins`
where
`f_charges_magasins`.`CDE_ANNEE` = `dim_temps`.`CDE_ANNEE`
group by
`dim_temps`.`CDE_ANNEE`

Below is the part of xml used :
<MeasureGroup name='Charges' table='f_charges_magasins'>
<Measures>
<Measure name='montant_charges' column='montant_charges' aggregator='sum' formatString='Standard'/>
</Measures>
<DimensionLinks>
<ForeignKeyLink dimension='Magasins' foreignKeyColumn='DIM_MAGASINS_ID'/>
<ForeignKeyLink dimension='Time' foreignKeyColumn='CDE_ANNEE' attribute='Year' >
<Column name='CDE_ANNEE'/>
</ForeignKeyLink>
<NoLink dimension='dim_clients'/>
</DimensionLinks>
</MeasureGroup>
sylvain.tacquet (2) [Avatar] Offline
#2
Re: Chapter 5.1.5 : Measures accross multiple table facts with different granul
Hi every one,

Has anyone an idea about this problem ? This would be an important feature (the ability to mix measures which have different granularities).
Rgds,