Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: SQL Group By

  1. #1

    Default SQL Group By

    I have a report which I am designing in the pentaho ad-hoc web based reporting tool.

    The report has several fields and is set to group on the region (in level 1). No other groupings are defined in the report. I have four regions: North, South, East, and West. I expected to see four groups when I run my report. Instead I get the regions repeating like North, South, North, East, North, South, etc....

    I turned my debug level in the log4j.xml file up to DEBUG and found the SQL query used to generate the report. It does not use a SQL group by at all. The query has all of the fields from the select clause and the filters defined in the where clause, but no grouping clause.

    How does pentaho group elements in a report? Why is my grouping not working? (Note: I initially thought that maybe there were typos in my groups like a 'North' and a 'North ', but I ran a select distinct on my database and verified that there are only four different groups with no spelling errors).

  2. #2
    Join Date
    Mar 2003


    If you use the Adhoc query tool, then you are using a metadata model to produce the SQL.

    Therefore, if the joins are not right or data is not aggregrated correctly, then the metadata model is to blame. It is important that your model defines the join conditions correctly, or our query generator will produce garbage (as in the famous computing principle of "garbage in -> garbage out").
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

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 - 2019 Hitachi Vantara Corporation. All Rights Reserved.