Submitted by Tom on 2011/06/14 05:16
From the docs, I think this not possible:
 
I want a field to be conditionally formatted based on whether the field itself is ticked but also based on whether another field is ticked
 
i.e. two conditions (yes/no fields) must be met before the field is coloured.
 
I tried using "|" in the sample grid with no success:
=0|AddressBook=0
 
Related manual page: Item Formatting
 

Comments

 
I guess I could do some kind of work around:-
 
I think the formats work in sequence - can I use "no colour" or default (i.e. item) colour?
 
=0                      [Insert colour here]
FieldB=0         [change/remove colour here]
 
would mean:
field not ticked => field colour changes
other field (FieldB) not ticked => colour changes again or, if possible, simply removes first format
 
 

reesd

2011/08/31 21:01

In reply to by Tom

I'm now thinking instead of dealing with the grid widget's built-in conditional formatting language, we should just be using IQ's equations like we can for item colors. See conditional format using row equations.
 
d

Humm... true, this was not possible, but it is now fixed, in the coming release (v0.9.25U)
 
Item Formatting was updated !
 

Tom

2011/06/21 07:35

In reply to by Pierre_Admin

[quote=Pierre_Admin]
Humm... true, this was not possible, but it is now fixed, in the coming release (v0.9.25U)
[/quote]
sounds good Pierre

reesd

2011/07/02 21:00

In reply to by Pierre_Admin

[quote=Pierre_Admin]
Humm... true, this was not possible, but it is now fixed, in the coming release (v0.9.25U)
 
Item Formatting was updated !
 
[/quote]
 
Cool, and we can do it based on text values now also I see!

Armando

2011/07/03 11:04

In reply to by reesd

Wow, I'll have to check that one out... That and negative values too (used to have a problem with those) -- did you try ?
 
(From Item Formatting : "Negative values can not be used in Conditional Format criteria. See 0993 Conditional Format : won't work if negative values are used." )
 
--------------------------------------------------------------------------------
Windows XP Home Edition, Service pack 2
Dell Vostro 1500, Ram:3gb, CPU:Core2Duo T7500 2.2ghz

Armando

2011/07/14 00:35

In reply to by Armando

[quote=Armando]
[....]negative values too (used to have a problem with those) -- did you try ?
 
(From Item Formatting : "Negative values can not be used in Conditional Format criteria. See 0993 Conditional Format : won't work if negative values are used." )
[/quote]
 
It now works ! Cool. Thanks. I updated the documentation.

Tom

2011/07/13 12:01

In reply to by Pierre_Admin

[quote=Pierre_Admin]
Humm... true, this was not possible, but it is now fixed, in the coming release (v0.9.25U)
 
Item Formatting was updated !
[/quote]
 
I'm afraid I need it spelled out (how to make field colour conditional on two fields - i.e. both fields have to be as designated in order for formatting to happen).
 
is it related to this? (or did I miss it completely?!)
BIG EDIT - I found this:
 
> 4- Starting v0.9.25U, the criteria can include more than 1 field, such as [Amount] >100 and [PaidBy] = "Credit"
 
but I still have no idea how to implement - I want it to be dependent on two fields being ticked.
 
thanks in advance!
Tom

Armando

2011/07/14 00:50

In reply to by Tom

[quote=Tom]
[quote=Pierre_Admin]
Humm... true, this was not possible, but it is now fixed, in the coming release (v0.9.25U)
 
Item Formatting was updated !
[/quote]
 
I'm afraid I need it spelled out (how to make field colour conditional on two fields - i.e. both fields have to be as designated in order for formatting to happen).
 
is it related to this? (or did I miss it completely?!)
BIG EDIT - I found this:
 
> 4- Starting v0.9.25U, the criteria can include more than 1 field, such as [Amount] >100 and [PaidBy] = "Credit"
 
but I still have no idea how to implement - I want it to be dependent on two fields being ticked.
 
thanks in advance!
Tom
[/quote]
 
Hi Tom!
 
Sorry for the delay. I just tried and I'm happy to report that it works. You really need to respect the syntax though as the parser seems to be very capricious.
 
these didn't work:
 
Amount >100 and PaidBy = "Credit"   ("[ ]" are missing... not good.)
 
[Amount >100] AND [PaidBy] = "Credit"  (AND is in uppercase... not good. Only lower case seems to work for the logical operator.)
 
this worked
 
[Amount] >100 and [PaidBy] = "Credit"
 
Similarly, for another field, this worked too :
 
[Comptes] <>0 and [Multiplicateur] < 0   ( "<> 0" for the "comptes" field means that the Y/N field is checked. The other field is a number field)
 
 
I'll update the docs to specify the catches here.
 
 
HTH !
 
P.S. : Pierre : is that syntax temporary or is it there to stay ? There seems to be some discrepancies between single conditions and complex ones -- e.g.:  use of "[ ]" delimiters, and the need to use lower case operators which seems  counter intuitive since programming languages either "prefer" uppercase or just don't care.
 
 
--------------------------------------------------------------------------------
Windows XP Home Edition, Service pack 2
Dell Vostro 1500, Ram:3gb, CPU:Core2Duo T7500 2.2ghz

Pierre_Admin

2011/07/14 14:16

In reply to by Armando

Hi Armando,
 
  1. Amount >100 and PaidBy = "Credit"   ("[ ]" are missing... not good.)

    I was not able to reproduce this. it works here without [  ]
     
  2. (AND is in uppercase... not good. Only lower case seems to work for the logical operator.)

    This is now fixed

Armando

2011/07/14 14:18

In reply to by Pierre_Admin

[quote=Pierre_Admin]
Hi Armando,
 
  1. Amount >100 and PaidBy = "Credit"   ("[ ]" are missing... not good.)

    I was not able to reproduce this. it works here without [  ]
     
  2. (AND is in uppercase... not good. Only lower case seems to work for the logical operator.)

    This is now fixed
[/quote]
 
1. Strange. I tested a few times before posting. I'll try again.
 
2.Thanks  :)
 
--------------------------------------------------------------------------------
Windows XP Home Edition, Service pack 2
Dell Vostro 1500, Ram:3gb, CPU:Core2Duo T7500 2.2ghz

Armando

2011/07/14 14:29

In reply to by Armando

[quote=Armando]
[quote=Pierre_Admin]
Hi Armando,
 
  1. Amount >100 and PaidBy = "Credit"   ("[ ]" are missing... not good.)

    I was not able to reproduce this. it works here without [  ]
     
  2. (AND is in uppercase... not good. Only lower case seems to work for the logical operator.)

    This is now fixed
[/quote]
 
1. Strange. I tested a few times before posting. I'll try again.

[/quote]
 
As usual, I must of done something weird. Yes, it does work.
I suspect I wrote  "and"  as "And" or something like that...

Tom

2011/08/10 10:47

In reply to by Armando

 
Sorry,
I cannot get this to work at all
 
I want yes/no field x to be coloured orange if it is NOT ticked and if it IS a file.
So, I tried each of the following under it's conditional formatting:
  • [me]=0 and [FileRef]<>0
  • =0 and [FileRef]<>0
Results in no highlighting at all
Any ideas??
 
(as =0 it worked but was showing orange for non files where it not relevant)
 
 

Win 7 Pro 64bit ~ Portable latest IQ  (9.25.V3)

Armando

2011/08/10 20:39

In reply to by Tom

My guess is that the fileref or the "me" columns/fields don't appear in the grid.
This is a "limitation" of conditional formats (it also has advantages as it allows one to control if  a conditional format functions or not in a specific grid) : fields involved in the condition must appear in the grid (columns can be narrowed to be made almost invisible if one doesn't want to see those)
 
--------------------------------------------------------------------------------
Windows XP Home Edition, Service pack 2
Dell Vostro 1500, Ram:3gb, CPU:Core2Duo T7500 2.2ghz

Tom

2011/08/11 05:48

In reply to by Armando

[quote=Armando]
My guess is that the fileref or the "me" columns/fields don't appear in the grid.
This is a "limitation" of conditional formats[/quote]
 
Thanks Armando,
I forgot about that 
 
 
only this one works BTW
[me]=0 and [FileRef]<>0
 
this one doesnt work:
=0 and [FileRef]<>0
I get the error message that =0 refers to something that isn't in the grid - I thought it refered to the field where it is in the conditional formatting (same as [me]). That field is definitely in the grid....
 
-------------------------------------------------------------------------------
Win 7 Pro 64bit ~ Portable latest IQ  (9.25.V3)