Jump to content
Changes to the Jaspersoft community edition download ×

How to use Filter Expression


justin.watts

Recommended Posts

I'm trying to use the filter expression, but I can't find a formula that filters my data accordingly.

I have one parameter (PlacementDays) and one variable (TotalPEIMSDays).  They both are set to class BigDecimal.  I am trying to say the following:

When $P{PlacmentDays} is entered as 0, then show me all records, else show me records where $V{TotalPEIMSDays} >= $P{PlacementDays}(based on input by user).

How do I accomplish this?

 

 

 

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

I am using SQL to retrieve data.  It seems I'm making it harder that it should be.  All I want to say is show records based on the following formula:

Where $V{TotalPEIMSDays} >= $P{PlacementDays}

Both the variable and parameter are set to Integer class.  $P{PlacementDays} is just the parameter input for the user.  $V{TotalPEIMSDays} is a created variable by taking the sum of a field pulled from the SQL (ACTUAL_PEIMS_DAYS, which is also set to Integer).

Link to comment
Share on other sites

I think the issue I am having is I'm trying to do == in one part of the expression and then do >= in another part of the expression, which I haven't found out how to do successfully.  Is there a  way to simply say $V{TotalPEIMSDays} >=  $P{PlacementDays}? What class do the variables and parameters have to be?  I

Link to comment
Share on other sites

  • 1 month later...

I tried the following expression, but getting an error that integer cannot be cast to boolean.  Both the $P and the $V are set to integer class; will not work with bigDecimal either.

IF($V{TotalPEIMSDays} >= $P{PlaceLimit},$V{TotalPEIMSDays},$V{TotalPEIMSDays})

Link to comment
Share on other sites

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