Jump to content
Changes to the Jaspersoft community edition download ×

Mondrian schema - MeasureExpression


disorder

Recommended Posts

Hi,

I have problem with definition of measure in modrian cube schema. I need measure which is not from column but counted with some expression.

Definition of my measure is:

Code:

<Measure name="Activity" type="Numeric" aggregator="sum" formatString="#,###0.00">
<MeasureExpression>
<SQL dialect="generic">
(IF(grp='ASS',czkeq,0)+IF(grp='ASL' AND czkeq>0,czkeq,0))
</SQL>
</MeasureExpression>
</Measure>

 

When I run report I get exception

Code:
[code]
Caused by: org.eigenbase.xom.XOMException: In element 'Schema': In element 'Cube': In element 'Measure': Attribute 'column' is unset and has no default value.
at mondrian.olap.MondrianDef$Schema.<init>(MondrianDef.java:127)
at mondrian.rolap.RolapSchema.load(RolapSchema.java:218)
... 71 more

Thats right, column isn't there because i want to use expression.

I followed example from documentation, where also isn't column in the tag defined.

Is there problem with version? I'm using JI 1.0

 

thx for reply

 

dis

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

It looks like the schema XML was not parsed properly. Can you put the expression in CDATA tags?

 

MeasureExpression is not widely used. You can probably define a custom member in your MDX or schema that does what you want. Check out the IIF MDX function.

 

 

Sherman

JasperSoft

Link to comment
Share on other sites

I got there CDATA tags, but it didn't help. There must be problem somewhere in the definition of xml schema.

I solved this problem so I created <View> with these counted columns.

Also custom columns should help, I'll try it, it seems better solution than my.

 

thx for reply

 

dis

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...