Filtering based on Villain stats

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

Moderators: WhiteRider, kraada, Flag_Hippo, morny

Filtering based on Villain stats

Postby bel42 » Thu Jun 10, 2021 11:24 am

Suppose I want to only look at hands I played against "regs".

A reg is defined as someone I have 1000 hands on. Or it could be defined as someone with VPIP/PFR/AF in a certain range.

Is there a way to do this? I searched in the forum archives and didn't find anything.
Posts: 3
Joined: Tue Oct 01, 2019 10:09 am

Re: Filtering based on Villain stats

Postby Flag_Hippo » Fri Jun 11, 2021 1:23 pm

That would require a custom expression filter using a subquery like this:

Code: Select all
cash_hand_player_statistics.id_hand in (select chps.id_hand from cash_hand_player_statistics chps, cash_cache cc where chps.id_player = cc.id_player group by chps.id_hand, chps.id_player having ((sum(cc.cnt_vpip) * 1.0) / (sum(cc.cnt_hands) * 1.0) - sum(cc.cnt_walks) * 1.0) < .35 and (sum(cc.cnt_hands) > 1000 and not chps.flg_hero))

You can use this expression filter by clicking on the 'Filters' link in a custom report and selecting 'Add New Expression Filters' and you will need to replace all instances of 'cash' with 'tourney' if you are in a tournament report.

This particular expression will filter for players with less than 35% VPIP and more than 1,000 hands but bear in mind that if you are not playing heads up games then this will only be filtering to hands where players like this were dealt in at the table - not that they played in a pot against you but you can edit this code to be more specific with regards to the actions they take and/or add/use different columns for testing other values. Also if you use a custom hand report and the filter returns an error then change the hands dropdown to 'All Hands' but bear in mind that filters like this can generate a lot of PostgreSQL processing so can take a while to complete if you have a large database.

If you need it see this guide for the basics on custom statistics creation, this guide for a deeper walkthrough and for more on how SELECT works see here.
Posts: 10948
Joined: Tue Jan 31, 2012 7:50 am

Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: Google [Bot] and 7 guests