[Mondrian] Top X across measure groups error

Matt Campbell mcampbell at pentaho.com
Mon Aug 17 08:31:13 EDT 2015

In virtual cubes in M3, and presumably with multiple measures groups in M4, native tuple queries will bring two or more fact table queries together by unioning.  In M3 there’s a check that prevents using the native topcount evaluator with virtual cubes.  It’s possible that check is not present or not working w/ multiple measure groups.

If you can, reproduce in Foodmart and add it to 2391.  Also attach the logs.

From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On Behalf Of Tom Barber
Sent: Sunday, August 16, 2015 8:12 AM
To: Mondrian developer mailing list <mondrian at pentaho.org>
Subject: [Mondrian] Top X across measure groups error

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/20150817/d4038e87/attachment.html 

More information about the Mondrian mailing list