Jump to content
Changes to the Jaspersoft community edition download ×

Help Creating Conditional Expression


adam_7
Go to solution Solved by plambert_1,

Recommended Posts

Hello All,

I am not very good when it comes to java and i was hoping someone could help me with some conditional formatting in a report.

I have two columns that both contain BigDecimal values. One columns is the averages sales per day (over the past 60 days), and the second column is the total sales over the past 3 days.

I would like to create a conditional style that highlights the 3 day sales value if it is over 3 times larger than the average day sales. This is to show a recent influx of sales on a product over the past 3 days compared to the typical average.

Here is an exmple of the simple math expressions:

if  (3 day total) > (60 day average x 3) - highlight green

I am pretty sure i can set up the styles how i want, i just dont know how to take the above math expression and actually create a java expression out of it.

 

Any help or advice would be appreciated.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I get undefined operators when i try to use > or * in the expression. That was my problem when trying to get the expression set up.

 

I think it wants me to use java expressions like this from a different report i have:

($V{Margin}.divide($V{Adjusted Retail})

 

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