filter hands based on specific stat value

Posted:
Mon Dec 22, 2025 10:07 am
by BloMur
Hello,
Is it possible to filter hands based on specific stat value,
fe if I would like to filter hands based on players VPIP > 80% in heads up and at least 10 hands played from SB ?
Re: filter hands based on specific stat value

Posted:
Mon Dec 22, 2025 4:18 pm
by Flag_Hippo
Try this expression filter:
- Code: Select all
tourney_hand_player_statistics.id_hand IN (
SELECT thps.id_hand
FROM tourney_hand_player_statistics thps
WHERE NOT thps.flg_hero
AND thps.cnt_players = 2
AND thps.id_player IN (
SELECT thps_hu.id_player
FROM tourney_hand_player_statistics thps_hu
JOIN lookup_actions lookup_actions_p ON thps_hu.id_action_p = lookup_actions_p.id_action
WHERE thps_hu.cnt_players = 2
GROUP BY thps_hu.id_player
HAVING (SUM(CASE WHEN thps_hu.flg_vpip THEN 1 ELSE 0 END) * 1.0) /
(COUNT(*) - SUM(CASE WHEN lookup_actions_p.action = '' THEN 1 ELSE 0 END)) > 0.80
AND SUM(CASE WHEN thps_hu.flg_blind_s THEN 1 ELSE 0 END) >= 10))
These type of filters can require a lot of PostgreSQL processing to query the hands in the database and will take longer to complete the bigger the database is. For more on how SELECT works see
here.