ThoroTech    ThoroTech Racing    ThoroTech Racing  Hop To Forum Categories  EquiSim - Using    Expression logic question
Page 1 2 
Go
New
Find
Notify
Tools
Reply
  
Expression logic question
 Login/Join 
Graded Stakes
Posted
Nathan,

I would like to create an expression that will put $ppSpeedFig in a column if the finish of the paceline was either in the money or within 5 lengths. Maybe it's just too late at night but I can't seem to see how to do this. Help...

Thanks
Lou
 
Posts: 284 | Location: Chicago Area | Registered: March 28, 2004Reply With QuoteReport This Post
Steward
Graded Stakes
Picture of Nathan M.
Posted Hide Post
Of course, its the "OR" that causes the trouble.
Let's see:
$ppSpeedFig * #LESSER($ppFinish, 4)
That gives you the speed fig if the finish was in the money - otherwise its a zero

$ppSpeedFig * #LESSER($ppBtnLengthsFinish * #GREATER($ppFinish, 1), 5)

That gives you the speed fig if the btnlengths are less than 5, or the horse won the race.


Now, and AND would be easy - this says show the speed fig if the horse was in the top 3 and was beaten by no more than 5 lengths:

$ppSpeedFig * ( #LESSER($ppFinish, 4) * #LESSER($ppBtnLengthsFinish * #GREATER($ppFinish, 1), 5) )

I'm not seeing an easy way to do the OR, other than to use two separate columns....
 
Posts: 1981 | Location: North East OH | Registered: July 23, 2002Reply With QuoteReport This Post
Graded Stakes
Posted Hide Post
Thanks - I thought it was just me. I'll try the two-column approach and go from there with a #GREATER(#COLVAL...) to get it all in one column.

Best to you and yours,

Lou
 
Posts: 284 | Location: Chicago Area | Registered: March 28, 2004Reply With QuoteReport This Post
Graded Stakes
Posted Hide Post
Lou,

How did you wind up resolving this? I have the same test as you but want to assign a point value instead of the $ppSpeedFig value. I am still trying the V5 demo; not much of a coder and really miss being able to use conditional statements. Any help would be appreciated. Thanks.

HH
 
Posts: 213 | Location: Chicagoland | Registered: November 23, 2003Reply With QuoteReport This Post
Graded Stakes
Posted Hide Post
HH,

Actually, I haven't resolved it yet - got involved in other things but I'm sure it can be accomplished using multiple columns as Nathan suggested.

Lou
 
Posts: 284 | Location: Chicago Area | Registered: March 28, 2004Reply With QuoteReport This Post
Graded Stakes
Posted Hide Post
HH,

Let me expand on that a bit...

col 1 #Lesser(BtnLengths, 5.1 + "LESSER(FinishPos, 4.1) gives a value between 0-2

col 2 #GREATER(#COLVAL(1), 0) * ppSpeedFig

Will that work? I dunno - try it.

Lou
 
Posts: 284 | Location: Chicago Area | Registered: March 28, 2004Reply With QuoteReport This Post
Graded Stakes
Posted Hide Post
sorry for the sloppy typing above but you get the idea...
 
Posts: 284 | Location: Chicago Area | Registered: March 28, 2004Reply With QuoteReport This Post
Graded Stakes
Posted Hide Post
Lou,

Thanks. Turns out that my idea was based on a max of 4 pp lines, hence I think I have to do it with #h functions. I came up with this mess:

12 * #GREATER((#LESSER(#hMIN("ppfinish", 0, 1000, 0, 50, 0, 0, 4, 0, 10000),4)) + (#LESSER(#hMIN("ppBtnLengthsFinish", 0, 1000, 0, 50, 0, 0, 4, 0, 10000),5)),0)

If either of the conditions were true, they would add up to a value of at least one. So if the value was >0 it would assign 12 points in the column.

I never could write tight code but this seems to work.

HH
 
Posts: 213 | Location: Chicagoland | Registered: November 23, 2003Reply With QuoteReport This Post
Graded Stakes
Posted Hide Post
Except that the above code will include an assignment of points if no PP (1st time starter). Not sure how to fix that.
 
Posts: 213 | Location: Chicagoland | Registered: November 23, 2003Reply With QuoteReport This Post
Graded Stakes
Posted Hide Post
HH - Multiply by #LESSER(number_of_races, 1) don't know the name of the variable for that, but there probably is one...

I'm in Des Plaines, IL by the way - almost spitting distance from AP.

Best,
Lou
 
Posts: 284 | Location: Chicago Area | Registered: March 28, 2004Reply With QuoteReport This Post
  Powered by Social Strata Page 1 2  
 

ThoroTech    ThoroTech Racing    ThoroTech Racing  Hop To Forum Categories  EquiSim - Using    Expression logic question

© 2002