filter hands based on specific stat value

Discuss how to create custom stats, reports and HUD profiles and share your creations.

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

filter hands based on specific stat value

Postby BloMur » Mon Dec 22, 2025 10:07 am

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 ?
BloMur
 
Posts: 67
Joined: Fri Nov 24, 2017 7:47 pm

Re: filter hands based on specific stat value

Postby Flag_Hippo » Mon Dec 22, 2025 4:18 pm

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.
Flag_Hippo
Moderator
 
Posts: 17062
Joined: Tue Jan 31, 2012 7:50 am


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 5 guests