Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

Mondrian 4 : Measures accross multiple table facts with different granularities

$
0
0
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 dimension.
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 Mondrian in Action.

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>

Viewing all articles
Browse latest Browse all 16689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>