Solved

Condiotional Formatting a Calculation Field

Posted on 2007-11-14
6
268 Views
Last Modified: 2010-05-18
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
Comment
Question by:aws148
  • 3
  • 3
6 Comments
 
LVL 28

Expert Comment

by:lesouef
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

by:aws148
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

by:
lesouef earned 500 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:aws148
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

by:lesouef
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

by:aws148
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Filemaker Output 6 219
FM - Design Issue 6 149
FileMakerPro10 required fields interfering with data entry. 3 75
Access vs. Filemaker Pro vs. SQL Server 4 70
Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question