Need Help With A Custom Stat

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Need Help With A Custom Stat

Postby kelso101 » Fri Mar 04, 2011 5:21 pm

I been trying to create a custom stat.

I want to do a numeric calculation involving one stat based on the value of another stat.

Example if (stat x) >=a and if (stat x) <(a+1) then (stat y)- 10 = new stat
Where (stat x) and (stat y) are known stats and 10 is a value that I predetermined based on the value of stat x

If pfr >=20 and if pfr <21 then cbet flop-10

Based on the value of PFR i want to subtract a value (determined by me) from CBET Flop.

Any help you give me would be appreciated.
kelso101
 
Posts: 10
Joined: Tue Apr 15, 2008 8:31 am

Re: Need Help With A Custom Stat

Postby WhiteRider » Fri Mar 04, 2011 6:20 pm

You should be able to use stat values in other stats' expressions, but alternatively you could create Variables to do the calculations and use the Value Expressions of each stat.

I don't have time to experiment now (bedtime here) but you should be able to create a new stat with a Value Expression like this:

if( #PFR# >=20 AND #PFR# < 21, #CBet Flop# - 10, 0 )

The 0 (zero) at the end is the value that the stat will have if the expression is false, so you'll probably want to change that.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Need Help With A Custom Stat

Postby kelso101 » Fri Mar 04, 2011 8:48 pm

I tried your suggestion and I tried a few variations but I still not getting what I want.
I think I didnt explain myself well.

If PFR >=20 and <21 then I want to subtract 10 from the CBet Flop value.
If PFR >=19 and <20 then I want to subtract (a differnt number ) from CBet Flop value.
if PFR >=18 and <19 then I want to subtract (a different number) from CBet Flop value.
this will continue for all PFR down to >=0 and <1

The result from subtracting the number from CBet Flop will be my NEW STAT.
The result from the above will produce a different value for each PFR value as the number being subtracted from CBet Flop will be different each time.

I understand I may have to create a different stat for each PFR >= X and PFR <X+1 since the number i will subtract from CBet Flop will be different for each stat.

Or I may have to nest all the statements into one large stat.

I tried both with poor results.

I want to do these stats as I am working on a point system.
kelso101
 
Posts: 10
Joined: Tue Apr 15, 2008 8:31 am

Re: Need Help With A Custom Stat

Postby WhiteRider » Sat Mar 05, 2011 6:14 am

I don't suppose the numbers you want to subtract follow a nice pattern, so that we could use a formula?
e.g.

#CBet Flop# - (0.5 * #PFR#)

Assuming not, you'd need to nest the IF statements like this:

if( #PFR# >=20 AND #PFR# < 21, #CBet Flop# - 10, if( #PFR# >=19 AND #PFR# < 20, #CBet Flop# - 9, if(...) ) )
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 10 guests