Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Aggregating Children Values into Parent nodes for Parent-Child hierarchies

  1. #1
    Join Date
    Aug 2017
    Posts
    2

    Question Aggregating Children Values into Parent nodes for Parent-Child hierarchies

    Greetings Mondrian community,

    I have recently started working with Mondrian and OLAP4J for a work assignment and things went mostly well so far. I have a cube created, populated and working as intended. What I need now is to fine-tune it to suit my employer's client's specific needs, and I have one problem I can't find a solution to anywhere.

    I have a couple dimensions with parent-child hierarchies in my cube, and they have been provided with a closure table for better performance. I need to provide a way to summarize all data from the children nodes inside the parent's node, like so:

    Dimension A has parent-child hierarchy H1, in which the root node is N1 (without any values), with child nodes N2 and N3, which have some values attached to them. Through MDX, I can get the values of N2 and N3 fine, but I needed these values aggregated into N1, such that if I provide a query that would return me only the value of N1, it would be the sum of N2 and N3. Likewise, if N2 and N3 had children nodes, I'd like them to return the sum of those nodes as their values, and so on.

    It's worth noting that, if any of the nodes have children, they won't have any value attached to them (so basically only leaf nodes would have any values), but it's still important to the client to have those higher granularity reports, hence my question.

    Thanks in advance, every comment/suggestion will be greatly appreciated.

    P.S.: I've been instructed not to post the actual cube/dimensions code due to company policy, but if any more information is needed I can provide a general view of the XML or cube.
    P.S.2: I'm currently using Mondrian Schema Workbench 3.14.0.0-12 to design my cube and using the latest OLAP4J source from github.

  2. #2
    Join Date
    Aug 2017
    Posts
    2

    Default

    I found out that the query wasn't showing the expected result because I had a closure table, of all things. I still have no idea as to why my closure table was causing this bug, since I used the same java class implemented in Kettle to generate it. Comments are still appreciated.

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 - 2017 Pentaho Corporation. All Rights Reserved.