Solved

Condiotional Formatting a Calculation Field

Posted on 2007-11-14
6
264 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now