innodat Posted December 8, 2009 Posted December 8, 2009 I have a field "XY" which collects values such as "A", "B" or "C". I'm looking for a conditional formatting formula which allows me to cover different parts of the layout in white. What I have is this: Transparent Layout Text 1 using Custom Formatting: XY ≤ "A" and XY ≥ "A" (--> fill color white) Transparent Layout Text 2 using Custom Formatting: XY ≤ "B" and XY ≥ "B" (--> fill color white) Transparent Layout Text 3 using Custom Formatting: XY ≤ "C" and XY ≥ "C" (--> fill color white) The problem is that this fills white if A, B or C IS part of field XY. How can I reverse that? I want the layout text to fill white when A, B, or C is NOT part of field XY. Any ideas?
comment Posted December 8, 2009 Posted December 8, 2009 XY ≤ "A" and XY ≥ "A" Isn't this a very long way to write XY = "A" ? If you want to reverse the condition, then either XY ≠ "A" or not ( XY = "A" ) should do.
innodat Posted December 8, 2009 Author Posted December 8, 2009 Not quite, the idea is that XY = A -- > surface 2 and 3 covered XY = A B -- > surface 3 covered XY = A C -- > surface 2 covered XY = A B C -- > nothing covered XY = "" -- > everything covered etc. A simple equal doesn't work, nor does the "not" option... unless I'm using it wrong.
innodat Posted December 8, 2009 Author Posted December 8, 2009 Can you give me a hint how I would use it in this context? I've attached a sample file, I'm sure it will be much clearer what I'm trying to achieve. Thank you for your help! CondSample.fp7.zip
innodat Posted December 8, 2009 Author Posted December 8, 2009 GOT IT, check this out: Filter(CondSample::Field 1; "A") ≠ "A" This simply checks if "A" is in field 1, regardless of its position. If not, the conditional formatting is set to fill white. See sample file attached. CondSample.fp7.zip
innodat Posted December 8, 2009 Author Posted December 8, 2009 Also, if your formatting depends on more than one value, such as Apple Pie Orange Juice you this will work: IsValidExpression (FilterValues (Your Field ; "Apple Pie" )) CondSample.fp7.zip
comment Posted December 8, 2009 Posted December 8, 2009 IsValidExpression (FilterValues (Your Field ; "Apple Pie" )) I'd suggest you use: IsEmpty ( FilterValues ( YourField ; "your value" ) ) The IsValidExpression() function is not appropriate for this use, and your test will fail if "your value" happens to be a valid expression, such as "true", for example.
Fitch Posted December 9, 2009 Posted December 9, 2009 You've got a good solution, but just FYI, I had in mind something like: Position( CondSample::Field 1 ; "A" ; 1; 1 ) That would evaluate to a positive number (i.e. True) if it finds "A" or 0 (False) if it doesn't. Many people use the PatternCount function for this kind of test, but that function has to count every instance of the search string; we're only interested in whether the string exists, and Position will stop counting when we hit the first instance of it, resulting in a totally imperceptible performance gain. :
innodat Posted December 9, 2009 Author Posted December 9, 2009 Even simpler... never thought of using the IsEmtpy function in this context - brilliant. Thanks! Fitch - I'm gonna go with comment's suggestion on this, but your input is very valuable. I know I can make use of it in many other situations.
Recommended Posts
This topic is 5553 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now