Link to home
Start Free TrialLog in
Avatar of metropia
metropiaFlag for United States of America

asked on

highlight, turn bold field based on condition in another field

I have a report with a column numeric name: cost change.

I would like to highlight and turn the font to bold in some cells when the value in cell cost change fluctuates +/- 2 cents.

Is there any chance someone can show me how the IIF would need to be coded?

Thank you.
Avatar of metropia
metropia
Flag of United States of America image

ASKER

I have this expression that does not work how I want it to work:

CASE
    WHEN (SUM(FavUnfavCostChange) < (2/100) THEN 'Less'
    WHEN SUM(FavUnfavCostChange) > (2/100) THEN 'More'
    ELSE NULL
END AS 'Flag'

But I get:

0.00000815000000000000            More    -- this is not more than 2 cents, is just a positive number
-0.00094700000000000000            Less     -- this is not less than 2 cents, is just negative number
-0.00222000000000000000            Less     -- this is not less than 2 cents, is just negative number
-0.00012250000000000000            Less     -- this is not less than 2 cents, is just negative number
0.00000000000000000000            NULL    -- this is zero so null is fine
0.01188576000000000000            More    -- this is not more than 2 cents, is just a positive number
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial