0
votes

I have a problem with filters in saiku 3.7 in Pentaho biserver CE, I want filters to be joined, what i mean is for example I have a sales table with data from Jan 1 2014 until Nov 25 2015... When user filter by year only 2015, I need in months only to show current data in this case it should show months only until November. Is this possible?

THis is part of my schema xml

    <Level name="Anio" visible="true" column="anio" type="Numeric" uniqueMembers="false" levelType="TimeYears" hideMemberIf="Never" description="A&#241;o Factura">
    </Level>
  </Hierarchy>
  <Hierarchy name="Trimestre" visible="true" hasAll="true" primaryKey="id">

    <Level name="Trimestre" visible="true" column="trimestre" type="String" uniqueMembers="false" levelType="TimeQuarters" hideMemberIf="Never">
    </Level>
  </Hierarchy>
  <Hierarchy name="Mes" visible="true" hasAll="true" primaryKey="id">

    <Level name="Mes" visible="true" column="mesno" type="Numeric" uniqueMembers="false" levelType="TimeMonths" hideMemberIf="Never" captionColumn="mes">
    </Level>
  </Hierarchy>
</Dimension>
<Dimension type="StandardDimension" visible="true"  highCardinality="false" name="Bodega">
  <Hierarchy name="Bodega" visible="true" hasAll="true" allMemberName="Bodegas" primaryKey="id">

    <Level name="Bodega" visible="true" column="Bodega" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
  </Hierarchy>
</Dimension>

Thanks for your help

1

1 Answers

0
votes

When you create a date dimension if your hierarchy is designed properly you will only get data returned for the rows that have data as Mondrian will do an inner join on your date dimension to your fact table.

So if you have a date dimension that is something like:

<Dimension name="my_date">
 <Hierarchy name="my_date_hierarchy">
  <Level name="years">
  <Level name="months">
  <Level name="days">
 </Hierarchy>
</Dimension>

Then join that to your fact table. If you have data for 2014 and 2015 and drop years onto an axis, you'll get data for 2014 and 2015 even if there are date dimension records for future dates. If you then drop months onto the same axis, you'll then see all the monthly data for 2014, 2015. If you then just wanted to see 2015 you could click on the years level on the rows axis, and select 2015 from the selections