[Mondrian] Top X across measure groups error

Tom Barber tom at analytical-labs.com
Sun Aug 16 08:11:36 EDT 2015

This is a long shot and I guess I'm going to have to delve into the MySQL
dialect stuff but I figured I'd check to see if anyone had seen similar
else where in mondrian:


Basically I have 2 measure groups, they both run off the same fact table
but they aggregaet differently so its nice to separate them.

When I run a Top count but add a measure from 2 different measure groups on
MySQL I get incorrect SQL generated

select `earthquakes`.`place` as `c0`, count(`earthquakes`.`id`) as `c1`
from `earthquakes` as `earthquakes` group by `earthquakes`.`place` union
select `earthquakes`.`place` as `c0`, count(`earthquakes`.`id`) as `c1`
from `earthquakes` as `earthquakes` group by `earthquakes`.`place`;

which causes

SQLException: Incorrect usage of UNION and ORDER BY

I tried messing with the union options in the mysql dialect but it didn't
seem to make a difference.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20150816/731b015d/attachment.html 

More information about the Mondrian mailing list