Submitted by Tom on 2013/07/05 11:17
 
Looking at the Equations page (I was thinking of adding the example that Jan gave Pulling vs Pushing row equations)
So I had a look at the Examples on that page Field Management Dialog - Equations
 
Okay,
the first one doesnt make an ounce of sense to me - it seems to me that there's a cut/paste typo on the first line, but even apart from that, there's no indication where the "Function..." script below the screenshot should go. Also, I have no idea what it's supposed to actually do.
Can someone help explain it and I can try and write it so as people like me will understand it

Row Equation Example 1

 Here is an example of using Auto-update and using a User Defined Field. For the Urgency field below, is required, is the Urgency field, as the CalcUrgency function uses the current date (see "now" below) to get an Urgency number (>0 is late):

Function CalcUrgency(Due, Duration, PDone, Done)   ' calculates an Urgency figure for tasks >0=late or will be late based on Duration and PercentDone
  if isnull(Done) and not isnull( Due ) then
     CalcUrgency = int( int(now) - int(cdate( nz( due ) )) + (nz(Duration) * (100-nz(PDone))/100 * 7/5) )
     if CalcUrgency<-60 then CalcUrgency=null
  else
     CalcUrgency = null
  end if
End Function


 
thanks !
I may ask about  other equations later but I'll stick with this one first.

Comments

 Hi Tom,
 
Where would the typo be ? It seems Ok to me...
 
The function script goes in user defined code (visual basic code)
 
Equations are always updated on a value change. The auto-update tell IQ to recalculate it each day. Useful for date dependent functions.
 
HTH !

Tom

2013/07/05 16:07

In reply to by Pierre_Admin

Hi Pierre, thanks for your response - maybe it's just too advanced for me ...
 
But anyways, the line that just doesnt make *any* sense to me is:

For the Urgency field below, is required, is the Urgency field, as the CalcUrgency function uses the current date (see "now" below) to get an Urgency number (>0 is late):

I mean it doesnt make sense gramatically - it there some formatting missing maybe?
I presume it's saying that the equation and script in question are *for* the urgency field.
But the next bits - "is required" and "is the Urgency field" - I suppose that's sql speak...
 
As this is advanced, I'm not expecting you to explain it all to me (you've better things to be doing!).
And if you're happy that someone at the necessary level can understand the sentence, then that's fine!
 
 
I might try and squeeze a simpler row equation example in there first though - so as people like me dont get scared off by the first example ;-)

Pierre_Admin

2013/07/05 16:10

In reply to by Tom

 Agreed, that sentence makes no sense at all. Might as well simply delete it !
 

jan_rifkinson

2013/07/05 16:50

In reply to by Pierre_Admin

So sorry, not to be rude but with the sentence or w/o the sentence, none of it makes sense to me. It's not english; it's geekspeak -- far too complex for the normal user (even if a slight techie) to construct a filter.  
 
I know what I'm about to say is not encouraging but look @ Zoot rules, actions & filters. It's day & night. 
 
Even someone like me who is not a tachie to be sure, who has used this kind of software since the first program of  this kind was invented by the first speadsheet folks (forgot the name right now) -- that is a good 30+ years -- has been able to follow along & create my own data controls via filters, rules & actions -- pull, push -- whatever you want to call it.  But not so with IQ.

And while I know that IQ goes far beyond most programs of this ilk, it is the most geeky of them all.

IMO, Zoot is the closest in "personality" and yet it is simpler to use on many levels & is more capable in some ways -- RSS feeds, emails, printing, cloud, editing notes, google calendar, docs, etc. 
 
I'm not crossing over as i still love IQ & the community here, have a lot invested in it but am getting frustrating....just sayin' 
 
PS: I love you, Pierre. (in a masculine sort of way) :-)

Pierre_Admin

2013/07/05 18:04

In reply to by jan_rifkinson

Jan,
 
Row equations (also called pull equations) should be simple to understand. They are no different than what you would do in Excel. For Field1, it could be :
  • = (Field2 * Field3) + Field4
  • = YourUserDefinedFunction(Field2, Field3) + Field4, where YourUserDefinedFunction is defined using the Visual Basic Editor
Auto-Assign rules (also called push equations) are the same, except you can set specific functions for each type of field operation (Add value, Modify value, Erase value). In addition, you can have as many as you wish. You could set this equation on any field (except Field1), such as Field2, Field3, and/or Field4.
  • AME:Field1 = (Field2 * Field3) + Field4
 
HTH !
 
Pierre
 
p.s. I love you too, Jan. (in a masculine sort of way )

jan_rifkinson

2013/07/05 18:13

In reply to by Pierre_Admin

 Yes, Pierre, that helps explain pull & push but you lost me the following "geekspeak" ;-)
 
YourUserDefinedFunction(Field2, Field3) + Field4, where YourUserDefinedFunction is defined using the Visual Basic Editor :-)

Pierre_Admin

2013/07/05 18:34

In reply to by jan_rifkinson

In the Visual Basic editor, you'll find that the code is divided in 3 sections System, User and This database.
In the System, there is a function called WorkTime. It takes 3 parameters. You can call this function in push or pull equations. But this is only when you want to do something fancy. Otherwise, you can simply use the first example.
 
Again, this is no different than you'd do in Excel (I realize that few people write VB code in Excel)
 

jan_rifkinson

2013/07/06 09:23

In reply to by Pierre_Admin

"[...]  this is no different than you'd do in Excel (I realize that few people write VB code in Excel)"
 
You make my point, Pierre. They don't have to.
In IQ we have to & therein lies IQ's real problem IMHO. 
Sooner or later you will have to develop filter, rules & actions that can be invoked in "English"   (i am using English in the sense that it's plain words, not formulas)