Print Page | Close Window

equal to formula

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22051
Printed Date: 06 May 2024 at 9:05am


Topic: equal to formula
Posted By: south
Subject: equal to formula
Date Posted: 11 Aug 2016 at 8:20am
Hello,
I have 2 fields in my report - order_qty and Job_run_qty
I want the Job_run_qty to be highlighted yellow only if it doesn't equal the job order qty.  It seems easy enough but I can't seem to get it to work I was using trying to have it print red but that didn't work at all either.  Here is what I had:
if ({Job_run_qty} = {order_qty}) then CRBlack else CRRed
Please help!



Replies:
Posted By: DBlank
Date Posted: 11 Aug 2016 at 10:40am
1. where are you placing this formula?
2. This is per row with each field in that row and not any summarized data, correct?
2. are you comparing the actual data or are you rounding in your display? Sometimes the one record has a different decimal value in it that might be rounded in the view on the report canvas but not the actual data.


Posted By: south
Date Posted: 11 Aug 2016 at 11:13am
1.  I am placing the formula in the Group Header section - Jobs
2. The order qty field has 1 number what ever is entered (for example 1 piece) the Job_run_qty is whatever is entered by by the people that are working on the job.
3.  Actual data should be whole numbers


Posted By: DBlank
Date Posted: 11 Aug 2016 at 11:24am
I am interpreting your answer to mean that the you want something in the group header (the entire background?) to change color and that this is like the max value of the Qty field for the group = the sum of the run qty value for the group. Does that sound correct?


Posted By: figgy
Date Posted: 12 Aug 2016 at 2:47am
I would like only the Job_run_qty field to be highlighted if it does not match the job_qty.  


Posted By: DBlank
Date Posted: 12 Aug 2016 at 3:53am
right click on the Job_run_qty field
select format field
select border tab
click on the formula button (x-2) next to Background
add your formula here
if table.Job_run_qty <> table.job_qty then crYellow else crNoColor


Posted By: figgy
Date Posted: 12 Aug 2016 at 4:47am
It worked!! I'm not sure why my formula didn't work?
Thank you so much for your help!



Print Page | Close Window