Jump to content
We've recently updated our Privacy Statement, available here ×
  • Custom Weighted Average Calculation for Crosstab Totals


    asimkin
    • Features: Reports Version: v7.1 Product: JasperReports® Server

    Issue Description

    Customer developed a crosstab report in Jaspersoft Studio.

    Per report specifications, the crosstab totals should be calculated as custom weighted average function.


    Resolution

    Let's review a report based on SugarCRM sample database, ORDERS table.

    The main idea is to manually add new measures, like:

    • WeightSum - to calculate Summary on required field
    • WeightedSum - to calculate average weighted by ShipVia with expression

    $F{ShipVia} * $F{Freight}

    The engine automatically creates variables for new measures which can be added to Crosstab Total columns.

    Attached is a sample report that displays both a standard average of order freight and an average weighted by ShipVia.


    Ref. Case 01466303

    lateordersreport.jrxml


    User Feedback

    Recommended Comments

    There are no comments to display.



    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...