Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Condiotional Formatting a Calculation Field

Posted on 2007-11-14
Medium Priority
272 Views
I am running Filemaker Pro v8.5 under Win XP.
How can I conditionally colour the output of a Calculation Field?

I have been using the following formulation (kindly received from this forum) to conditionally colour the text in a Text input field.  I use the Auto-enter Calculation Tab, then declick the do not replace existing value.

Case(Field="U";Colour Choice[1];
Field="D";Colour Choice[2];
"")

It works well, but I have not found a way to use the idea in a Calculation Field, which (obviously) already has a calculation in it.  I have tried using "AND" after the original calculation formula, and then inserting this idea, but I cannot get it to work, and it seems in fact to mess up the recalculation of the calculation field when that is otherwise necessary.

Would appreciate guidance.
0
Question by:aws148
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 3
• 3

LVL 28

Expert Comment

ID: 20288070
give me yr calc formula, I'll modify it to get it coloured.
and tell me the criteria to switch colours depending on the calc. value
0

Author Comment

ID: 20288197
Thanks.
The calculation formula is simply Number Field 1 - Number Field 2
I want to colour RED when result is <0.1 and BLUE when result is >0
0

LVL 28

Accepted Solution

lesouef earned 2000 total points
ID: 20289028
this won't work, there is an overlap in between 0 and 0.1
if that would be red for negative and blue for 0 and positive values:

result=
If ((number1 - number2) < 0 ;
TextColor ( number1 - number2; RGB ( 255; 0; 0) ) ;
TextColor ( number1 - number2; RGB ( 0;0; 255) )
)
0

Author Comment

ID: 20307121
Sorry for delay, I was called away to do some firefighting.
Thanks for the proposal, but I don't fully understand it.
I want this Calculation field (a) show the result of the calculation, which will be an integer, and (b) to colour the result red or blue.
As I understand your code it only does (b).
Could you clarify?
Thanks
0

LVL 28

Expert Comment

ID: 20308266
no, fm is quite clever on this, you can still manipulate the coloured expression as a number.
of course, the colour attribute will be lost in a further calculation, but you have nothing to do, it does a kind of automatic getasnumber() function on it if you use it a further calculation
0

Author Comment

ID: 20311929
Well that's a surprise.  I'd never have guessed that, but can confirm that it's working for me.
Thanks very much
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
###### Suggested Courses
Course of the Month6 days, 11 hours left to enroll