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

Referring to dimension attribute from within calculated member formula

$
0
0
Hi.


I'm trying to produce a Mondrian 4 schema (for use with Saiku), to allow analysis of job-shop manufacturing data. Batches of products will move around to different cells within the factory, according to the manufacturing operations that need to be performed on them. Principally, we want to be able to analyze what stuff is spending time where.


One important piece of information we want to be able to derive is the cycle time - how long it takes to perform an operation on one part.

When a batch of products arrives at a particular cell, there's a certain amount of time spent setting up, then a certain amount of time spent actually working on the batch ("production duration"). The cycle time then, would be the production duration divided by the batch quantity.


The problem that I have is that I can't figure out how to represent the batch quantity within the schema. The production duration is obviously a measure, and I can see how I can define a calculated member that would perform the division.


My guess is that the batch quantity should be an attribute of the same dimension that contains each batch's unique reference number, but I don't seem to be able to then refer to the batch quantity from within the formula of a calculated member. When I try to load a schema containing a calculated member as follows...


<CalculatedMember
name="cycle_time"
dimension="Measures"
formula="[Measures].[prod_minutes]/[batch].[batch_qty]"
/>


... Mondrian gives me the following error:


Caused by: mondrian.olap.MondrianException: Mondrian
Error:Failed to parse query
'WITH MEMBER [Measures].[Measures].[cycle_time]
AS '[Measures].[prod_minutes]/[batch].[batch].[batch_qty]',
[$member_scope] = 'CUBE',
MEMBER_ORDINAL = 2
SELECT FROM [tracking]'


Is there a different way that I should be constructing my formula, or am I doing something more fundamentally wrong?


(I have been able to make other calculated members work, for example adding the setup and production durations together, so it does seem that the error is being caused by me trying to refer to the batch qty attribute.)


Thanks for any suggestions.


- Nick

Viewing all articles
Browse latest Browse all 16689

Trending Articles



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