Submitted by DavidF on 2016/03/08 12:30

hi,

I am trying to work out how to use equations, auto-assignment etc in IQ. To that end I have read 4.042 Equations, Rules, and Scripting (node 128) and have been trying out some of its examples. Row equations seem pretty straightforward and I can get them to work – just like Excel. However I cannot get this assignment example to work: when you type “Breakfast” into the Item field, another field called Food is ticked.  I copied and pasted from the example and as far as I can see followed the instructions, but when I type “Breakfast” into Item, Food stays resolutely unticked.

I’ve made a grid called EquationTest and added to it a Yes/No field called Food:

In the Equation section of the field properties for Item I have put the following, as per the example:

But when I type “Breakfast” into Item, Food stays unchecked:

I feel there must be something really obvious I’ve missed out. Any help??

Comments

Hi DavidF !
 
Since the page Field Management Dialog - Equations was last updated, a small change was made to have more robust field processing : All Field must be enclosed by [  ]
 
So the valid equation should read: AM:[Food] = HasKeyword([Item],"Breakfast",-1)
 
(note that the last parameter, -1, is for case sensitive. Use 0 if you want case insensitive)
 
HTH !
 
Pierre_Admin
IQ Designer
 

DavidF

2016/03/08 14:16

In reply to by Pierre_Admin

thanks Pierre, that was exactly it!
 
Just as a side note: the crashes I was having with IQ (kernelbase.dll etc etc) stopped once I upgraded to 0.9.72, at least with the portable version.
 
David

DavidF

2016/03/08 14:23

In reply to by Pierre_Admin

OK, a follow-up question. How can you make the "rule" apply to existing items? Is there an equivalent of sh-f9 for auto-assignment? ie how would I make the rule apply to items that had "breakfast" in Item but where Food is not ticked (because I hadn't surrounded field names with square brackets)?
 
-- David

Pierre_Admin

2016/03/08 14:32

In reply to by DavidF

[quote]How can you make the "rule" apply to existing items? Is there an equivalent of sh-f9 for auto-assignment?[/quote]
Yes there is. Select all items and do Edit > Touch
 
Pierre_Admin
IQ Designer
 

DavidF

2016/03/08 15:52

In reply to by Pierre_Admin

Perfect, thanks!