Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Help with simple Measures and Schemas

  1. #1
    Join Date
    Oct 2011

    Default Help with simple Measures and Schemas

    I'm just starting learning Mondrian and MDX. I'm trying to start to build my measures for my schema. I read in the getting started part that all measures relate back to a column in the data model, but say I'm trying to figure out head count of a set of employees. Can I simply not sum up or count the rows returned by some criteria, or do I have to create a column just to hold a 1 in it to sum? Also is there a way to create a measure that's an aggregate function and a filter? For example, I'd like to come up with a permanent employee head count vs temporary head count. The criteria for what is a permanent employee vs temporary employee is just sum it up + a set of filters.

    What if I wanted to show head count vs projected head count where head count would come from the employee table, but projected would be from open requisitions in another table?


  2. #2
    Join Date
    Feb 2009


    You can choose count and distinct-count as aggregate functions and use e.g. the primary key of the table as your column, so there is no need to create a column with a 1 in it.

    Regarding your second question: You could create a calculatedMember that does this. For example if I only want to see the amount of sales for shipped orders I could create a CalculatedMember in the schema with the following formula: "sum({[type].[Shipped]},[Sales])". Almost every aggregation function in mdx takes a set as the first parameter.

    To access data from two fact tables you first need to define a cube on each fact table and then construct a virtual cube on top of your two cubes.
    Probably it would be easier to integrate the projected head count into the other fact table.
    Markus Burger-Scheidlin
    ITGAIN Consulting GmbH Hannover, Germany

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.