need help with custom stat - % folded after flop

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 custom stat - % folded after flop

Postby squeebo » Thu Nov 11, 2010 1:48 am

My first simple attempt at a statistic for % of time player folds on any street postflop. In the HUD it appears to work sometimes, but for many players it's 0, when I can see from the popup stat table that it shouldn't be. I copied some of the formatting from other examples, so I may have well screwed up. Any ideas?


section: Holdem cash player statistics

value expression for column cnt_fold_postflop:
Code: Select all
sum(if[
holdem_hand_player_statistics.flg_f_saw
AND (holdem_hand_player_statistics.flg_f_fold
OR holdem_hand_player_statistics.flg_t_fold
OR holdem_hand_player_statistics.flg_r_fold), 1, 0
])


value expression for statistic Fold Postflop %:
Code: Select all
(cnt_fold_postflop / cnt_f_saw) * 100


format expression:
Code: Select all
(cnt_fold_postflop / cnt_f_saw) * 100
squeebo
 
Posts: 29
Joined: Fri Dec 04, 2009 4:22 am

Re: need help with custom stat - % folded after flop

Postby shahrad » Thu Nov 11, 2010 4:30 am

I guess format expression has to be: /%.2f
shahrad
 
Posts: 118
Joined: Fri Oct 08, 2010 1:51 pm

Re: need help with custom stat - % folded after flop

Postby WhiteRider » Thu Nov 11, 2010 5:45 am

That looks like it should be OK, with one possible minor issue:
cnt_f_saw counts all times that you saw the flop including those times when the hand was checked down, meaning that you didn't have an opportunity to fold.

If you want to count only opportunities default post flop you could do it like this:

cnt_postflop_fold_opp =
sum( if[ (holdem_hand_player_detail.amt_f_bet_facing + holdem_hand_player_detail.amt_f_raise_facing + holdem_hand_player_detail.amt_t_bet_facing + holdem_hand_player_detail.amt_t_raise_facing + holdem_hand_player_detail.amt_r_bet_facing + holdem_hand_player_detail.amt_r_raise_facing) > 0), 1, 0 ] )

..which checks for facing any bet or raise post flop.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: need help with custom stat - % folded after flop

Postby squeebo » Thu Nov 11, 2010 1:06 pm

Ok, I'll try that. But what could account for the stat being 0 for many players for whom the popup stats show they folded several times on the flop?
squeebo
 
Posts: 29
Joined: Fri Dec 04, 2009 4:22 am

Re: need help with custom stat - % folded after flop

Postby kraada » Thu Nov 11, 2010 1:49 pm

I'm not sure but you could simplify the expression some:

sum(if[ holdem_hand_player_statistics.flg_f_saw AND holdem_hand_player_statistics.enum_folded != 'N', 1, 0])

will also work - they saw the flop (so we know they didn't fold preflop) and they didn't not fold ('N' is no fold), so they must have folded somewhere postflop.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: need help with custom stat - % folded after flop

Postby squeebo » Thu Nov 11, 2010 2:30 pm

So I've isolated the problem somewhat. When I run Update Cache in housekeeping, the stat is are updated for all players, but it stops counting from that point for all existing and new players added to the database. So for example, the stat for all new players added since housekeeping is 0. For existing players, the count is not updated. If a player before housekeeping folded 5 out of 10 times post flop, the stat is 50% (5/10). If he folds 5 out of the next 5 times post flop, the stat is 30% (5/15 instead of 10/15) and as such continues to go down regardless of how often he folds.

What would cause a stat to not be updated like this except when I run housekeeping? I've verified it by checking the stats of about 9 players who existed prior to housekeeping, and all the ones that were not in the database prior to housekeeping continue to have a stat of 0%.

I've changed the statistic's format expression to /%.2f with no apparent result.

I also just ran Update Cache again, which finished in a second this time instead of 30 minutes, and now the existing players prior to that still don't have updated stats. So I'm confused.
squeebo
 
Posts: 29
Joined: Fri Dec 04, 2009 4:22 am

Re: need help with custom stat - % folded after flop

Postby kraada » Thu Nov 11, 2010 3:34 pm

What version of PT3 are you currently using?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: need help with custom stat - % folded after flop

Postby squeebo » Thu Nov 11, 2010 3:40 pm

v 3.06.2
squeebo
 
Posts: 29
Joined: Fri Dec 04, 2009 4:22 am

Re: need help with custom stat - % folded after flop

Postby kraada » Thu Nov 11, 2010 4:44 pm

Try upgrading to our most recent beta and see if that helps.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: need help with custom stat - % folded after flop

Postby squeebo » Thu Nov 11, 2010 5:35 pm

Ok, the latest beta looks to have fixed the bug! The stat is updating now.
squeebo
 
Posts: 29
Joined: Fri Dec 04, 2009 4:22 am

Next

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

Who is online

Users browsing this forum: Amazonbot and 4 guests

cron
highfalutin