Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format Editor Formula - Font Change???

Status
Not open for further replies.

PQTIII

IS-IT--Management
Sep 21, 2004
110
0
0
I'm using an if-then statement to get @Forecast number (can be 1 of 2 numbers) and a formula to get an @Actual number. Once I get these two numbers I compare them and if @Actual < @Forecast I want the @Actual to show red. I've tried a formula in the Format Editor of the Format Field option. I check the Font Color and put @Actual < @Forecast in the formula box, but this will not work. It says that @Forcast must be a number. Is there another way to do this?

Thanks Paul
 
Try this in the Font Color formula box:


if @Actual < @Forecast then crred
else
crblack
 
Hi,

It sounds like @Forecast is not returning a numeric value.
Try wrapping the formula in Tonumber.

Tonumber(@Forecast)


Nuffsaid.
 
campsys' solution should work. I think the error message requiring a number refers to color number--you can either use crRed, etc., color(255,150,45), etc., or a number like 200.

-LB
 
When I try :

if @Actual < @Forecast then crred
else
crblack

It still says a number is expected.

When I tried:

ToNumber ({@Actual})<ToNumber ({@Forecast})

It says the formula result must be a number.


(@Actual) :If shared numbervar shifts > 0 then
{@Show Tons}/shared numbervar shifts else 0

(@Forecast) :If GroupName ({hist_loclist.region})="10W" then 138089 else
if GroupName ({hist_loclist.region})="9W" then 58426 else 0

Ex:
Region Crew Forecast Tons/Shift(Actual)
10w
A 138089 153211
B 138089 138222
C 138089 128000
9W
A 58426 48334
B 58426 52345
8W
D 0 3100



 
Try using this combination of the two. It should do it.


ToNumber ({@Actual})< ToNumber ({@Forecast})then crred
else
crblack

 
campsys

That worked just great, thanks!

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top