Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Need help

  1. #1
    Join Date
    Aug 2013
    Posts
    1

    Default Need help

    How to use row sum & column sum in crosstab report of pentaho ho report designer?

  2. #2
    Join Date
    Feb 2010
    Posts
    114

    Default

    Example Output:-
    Student / Subject Subject1 Subject2 Total

    Student1 95 90 185
    Student2 90 92 182
    Student3 90 92 182
    Total 275 274

    Example Query:-

    /*Cross tab query :-*/

    SELECT studentname, subjectname, marks
    from student
    group by studentname, subjectname

    union all

    /*Row sum query :-*/
    SELECT studentname, "Total" as subjectname, sum(marks) as marks
    from student
    group by studentname

    union all

    /*column sum query :-*/

    SELECT "Total" as studentname, subjectname, sum(marks) as marks
    from student
    group by subjectname

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.