Jump to content
Changes to the Jaspersoft community edition download ×
  • Using Calculated Fields to filter values from report data.


    ghudson_1

    Issue Description

    As of 6.3.0 Calculated Fields cannot be added to the filter pane, so they cannot be used to filter Ad Hoc View data, but they can be used with Saved Reports from Ad Hoc Views.

    Resolution

    Reports saved from Ad Hoc Views which are tabular are based on Table Components, thus contain Jive/Interactivity features like filtering and sorting.   Suppose you only want to see rows from your sales table for  homes remodeled 5 years ago but you aren't able to create this type of filtering via SQL, thus you must use Calculated Fields.   You could use something like the following expression to return the number of yrs since today for a date-time entry in the table:

    Round(ElapsedYears(Today(), "RemodelDate"), 0)

    Ensure the Calculate Field is in the columns for your Saved Report.  Then click the header for it and choose the "Column Filters" icon, choose "Equals 5" and apply to only show the most recently created entry:

    Capture(39).JPG.dbd33dffe286345c725790298ac5b7ab.JPG

     

    References:

    http://community.jaspersoft.com/documentation/tibco-jasperreports-server-user-guide/v621/interactively-filtering-report-output#running_reports_2536605942_1088794

    Ref. Case 01457811


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...