Filter hand reports by player stats

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

Filter hand reports by player stats

Postby DeepMig » Wed Oct 12, 2011 1:25 pm

Hello,

I want to analyse hands from players who meet a certain condition for a particular player stat.
Example: i want to list all the hands that contain a 3-bet from players who 3-bet less than 10% of the time.
I tried creating a custom report in the section 'Holdem Tournament Hand' then use the filter 3-bet preflop.
Then I wanted to add a custom filter like '3Bet Pre3flop < 10', but this stat is not available because it belongs to the Player's section.
Is there any way do achieve this, either with reports or another method?

Thanks for your time,
Miguel
DeepMig
 
Posts: 39
Joined: Tue Mar 16, 2010 8:39 am

Re: Filter hand reports by player stats

Postby kraada » Wed Oct 12, 2011 2:21 pm

Yes, it's just quite complicated.

For example, this filters for hands with players who have VP$IP between 15 and 20:


player.id_player in (SELECT player.id_player from player, holdem_hand_player_statistics where player.id_player = holdem_hand_player_statistics.id_player GROUP BY player.id_player HAVING (((( (CASE WHEN ( (sum((case when(holdem_hand_player_statistics.id_hand > 0) then 1 else 0 end)))) <> 0 THEN (((sum((case when(holdem_hand_player_statistics.flg_vpip) then 1 else 0 end))) * 1.0 )/( (sum((case when(holdem_hand_player_statistics.id_hand > 0) then 1 else 0 end))))) ELSE 0 END) ) * 100) BETWEEN 15 AND 20)))

You use this text in the blue Filters link in the Reports tab and it will work on any holdem cash game section.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Filter hand reports by player stats

Postby DeepMig » Wed Oct 12, 2011 2:59 pm

If it's not asking too much, could you post how the same filter would look for tournament hands instead of cash?
Thanks.
DeepMig
 
Posts: 39
Joined: Tue Mar 16, 2010 8:39 am

Re: Filter hand reports by player stats

Postby kraada » Wed Oct 12, 2011 3:11 pm

Change "holdem_hand_player_statistics" to "tourney_holdem_hand_player_statistics" and that will make it for tournaments; nothing else is required.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Filter hand reports by player stats

Postby DeepMig » Wed Oct 12, 2011 4:20 pm

Thanks a lot kraada.

I made a 3bet preflop filter and it looks like this:

player.id_player in (SELECT player.id_player from player, tourney_holdem_hand_player_statistics where player.id_player = tourney_holdem_hand_player_statistics.id_player GROUP BY player.id_player HAVING (((( (CASE WHEN ( (sum((case when(tourney_holdem_hand_player_statistics.flg_p_3bet_opp) then 1 else 0 end)))) <> 0 THEN (((sum((case when(tourney_holdem_hand_player_statistics.flg_p_3bet) then 1 else 0 end))) * 1.0 )/( (sum((case when(tourney_holdem_hand_player_statistics.flg_p_3bet_opp) then 1 else 0 end))))) ELSE 0 END) ) * 100) BETWEEN 30 AND 50)))

It's working but it gives me ALL the hands from players who 3bet between 30% and 50%.
Now I want to list only hands containing a 3bet from those players.
I tried adding a simple filter, but it didn't work.
Do I need a few more lines to the filter code?
DeepMig
 
Posts: 39
Joined: Tue Mar 16, 2010 8:39 am

Re: Filter hand reports by player stats

Postby kraada » Wed Oct 12, 2011 5:09 pm

You actually need to change the structure some. You want it to look like this for that kind of analysis:

tourney_holdem_hand_player_statistics.id_hand in (SELECT player.id_player from player, tourney_holdem_hand_player_statistics where tourney_holdem_hand_player_statistics.flg_p_3bet and player.id_player = tourney_holdem_hand_player_statistics.id_player GROUP BY player.id_player HAVING (((( (CASE WHEN ( (sum((case when(tourney_holdem_hand_player_statistics.flg_p_3bet_opp) then 1 else 0 end)))) <> 0 THEN (((sum((case when(tourney_holdem_hand_player_statistics.flg_p_3bet) then 1 else 0 end))) * 1.0 )/( (sum((case when(tourney_holdem_hand_player_statistics.flg_p_3bet_opp) then 1 else 0 end))))) ELSE 0 END) ) * 100) BETWEEN 30 AND 50)))

The changes here: We're now filtering for individual hands, not individual players (hence getting only hands where these players did some action), and we added tourney_holdem_hand_player_statistics.flg_p_3bet to the WHERE clause, so now we're only looking at hands where these specific players also made a 3bet.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Filter hand reports by player stats

Postby DeepMig » Wed Oct 12, 2011 5:50 pm

I understand your logic and it sounds correct, but for some reason the filter it's not working.
I tried to make some changes, but couldn't get it to work.
Did you test it yourself?
DeepMig
 
Posts: 39
Joined: Tue Mar 16, 2010 8:39 am

Re: Filter hand reports by player stats

Postby kraada » Thu Oct 13, 2011 9:10 am

I missed one small additional change:

tourney_holdem_hand_player_statistics.id_hand in (SELECT tourney_holdem_hand_player_statistics.id_hand from player, tourney_holdem_hand_player_statistics where tourney_holdem_hand_player_statistics.flg_p_3bet and player.id_player = tourney_holdem_hand_player_statistics.id_player GROUP BY player.id_player HAVING (((( (CASE WHEN ( (sum((case when(tourney_holdem_hand_player_statistics.flg_p_3bet_opp) then 1 else 0 end)))) <> 0 THEN (((sum((case when(tourney_holdem_hand_player_statistics.flg_p_3bet) then 1 else 0 end))) * 1.0 )/( (sum((case when(tourney_holdem_hand_player_statistics.flg_p_3bet_opp) then 1 else 0 end))))) ELSE 0 END) ) * 100) BETWEEN 30 AND 50)))
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


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

Who is online

Users browsing this forum: No registered users and 0 guests