Help with filtering a player group

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

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Help with filtering a player group

Postby leviathan74 » Mon Jul 05, 2021 12:56 pm

Let's say I use a simple filter in order to tell apart a specific player group, like for example a filter that only includes players who have played more than 2,000 hands in my database.

I can do that. Then I get a list with all the player names who have played more than 2000 hands and I can check all the relevant stats for each player.

But let's say now that I want to see these players' collective stats sorted either by position or through stack size. I can export the player names and then manually create a filter that combine all of their names like so:

player.player_name = 'x100' OR player.player_name = x101' etc

I can also do that. But after a while this becomes a hassle to do by hand.

How can I automate this process? Is there a better filter or some sort of mail merge form I can create in word or something?
leviathan74
 
Posts: 84
Joined: Sun Sep 14, 2008 2:52 pm

Re: Help with filtering a player group

Postby Flag_Hippo » Tue Jul 06, 2021 5:37 am

You can remove the 'Player' statistic from your report so it is not broken down into rows for each individual player.
Flag_Hippo
Moderator
 
Posts: 14505
Joined: Tue Jan 31, 2012 7:50 am

Re: Help with filtering a player group

Postby leviathan74 » Tue Jul 06, 2021 8:51 am

Flag_Hippo wrote:You can remove the 'Player' statistic from your report so it is not broken down into rows for each individual player.


Thank you, but I am afraid this isn't working because if I remove the player statistic, then the program views all the pop stats stats as one player stats.

For example, if I use a filter like VPIP>40, it doesn't show me the pop statistics of the players who VPIP more than 40%. it doesn't show me anything because as a whole, the population VPIPs less than 40%.
leviathan74
 
Posts: 84
Joined: Sun Sep 14, 2008 2:52 pm

Re: Help with filtering a player group

Postby Flag_Hippo » Tue Jul 06, 2021 12:44 pm

That works with the expression filter you gave for player names in your original post whether the player name is in the report or not.

It's not going to work with a simple filter for VPIP if you've removed the player grouping.

If you've removed the player grouping then to filter on VPIP is going to require an expression filter with a subquery like this:

Code: Select all
player.id_player in (SELECT p.id_player from player p, cash_cache cc where p.id_player = cc.id_player group by p.id_player HAVING (( sum(cc.cnt_vpip) / (sum(cc.cnt_hands) - sum(cc.cnt_walks)) > .4)))

That example is for a VPIP above 40 percent but the same principle can be applied to filter for other statistics. For more on how SELECT works see here.
Flag_Hippo
Moderator
 
Posts: 14505
Joined: Tue Jan 31, 2012 7:50 am

Re: Help with filtering a player group

Postby leviathan74 » Tue Jul 06, 2021 2:03 pm

Flag_Hippo wrote:That works with the expression filter you gave for player names in your original post whether the player name is in the report or not.

It's not going to work with a simple filter for VPIP if you've removed the player grouping.

If you've removed the player grouping then to filter on VPIP is going to require an expression filter with a subquery like this:

Code: Select all
player.id_player in (SELECT p.id_player from player p, cash_cache cc where p.id_player = cc.id_player group by p.id_player HAVING (( sum(cc.cnt_vpip) / (sum(cc.cnt_hands) - sum(cc.cnt_walks)) > .4)))

That example is for a VPIP above 40 percent but the same principle can be applied to filter for other statistics. For more on how SELECT works see here.


Thank you again, but now I have to confess I am a bit lost, as I don't understand what the code you posted says and I haven't encountered it before. I will of course try to study it a bit more when I have time.

Just to clarify I cannot do individual player filters for 3000 player names or so because it will require tons of manual work. That's why I asked the question if there was a different, automated way. Like if i exported the report in a csv file is there an automated way to take the player names from that list and add the code for each of them automatically?

I also copy pasted the code you posted and then the reports seems to be loading and loading for minutes on end, but no stats appear.

This is an example of the code I was using on the expression filter before:
Code: Select all
cnt_hands>50 AND cnt_hands<25000 AND (cnt_vpip / (cnt_hands - cnt_walks)) * 100>15 AND (cnt_vpip / (cnt_hands - cnt_walks)) * 100<29


What else can I try?
leviathan74
 
Posts: 84
Joined: Sun Sep 14, 2008 2:52 pm

Re: Help with filtering a player group

Postby Flag_Hippo » Wed Jul 07, 2021 5:52 am

leviathan74 wrote:Just to clarify I cannot do individual player filters for 3000 player names or so because it will require tons of manual work. That's why I asked the question if there was a different, automated way. Like if i exported the report in a csv file is there an automated way to take the player names from that list and add the code for each of them automatically?

That might be possible but I don't have any knowledge in that area.
leviathan74 wrote:I also copy pasted the code you posted and then the reports seems to be loading and loading for minutes on end, but no stats appear.

Filters like this can generate a lot of PostgreSQL processing so can take a while to complete if you have a large database and/or your database is not on an SSD.
leviathan74 wrote:This is an example of the code I was using on the expression filter before:

Something like that isn't going to work without the player grouping. Bear in mind that even with player names the population data is on the summary line although there is a known issue where that information doesn't get exported in a .csv file but you can open a Support Ticket to be notified when it's fixed.
Flag_Hippo
Moderator
 
Posts: 14505
Joined: Tue Jan 31, 2012 7:50 am

Re: Help with filtering a player group

Postby leviathan74 » Wed Jul 07, 2021 9:59 am

Well, my computer is pretty fast with 64GB of Ram and an NVME drive.

My current database is 72GB big. However, I tried it in a smaller database which is less than 2GB and I get this:

https://i.imgur.com/rqCtXj0.png

If I add a position or a custom player stack stat, I get no results.

PS. I have hero filtered out with a simple filter.
leviathan74
 
Posts: 84
Joined: Sun Sep 14, 2008 2:52 pm

Re: Help with filtering a player group

Postby Flag_Hippo » Wed Jul 07, 2021 12:42 pm

You will need to replace "cash" with "tourney" if you are using that filter in a tournament report.
Flag_Hippo
Moderator
 
Posts: 14505
Joined: Tue Jan 31, 2012 7:50 am

Re: Help with filtering a player group

Postby leviathan74 » Wed Jul 07, 2021 8:45 pm

Well, I did and I left the report loading and it kept loading for hours without showing any results -even in the small database.

The good news is I managed to find a workaround by exporting the player names in a csv file, then adding the filter through a hack on notepad plus and then importing the filters into a new report. It still gives me a headache, because some special characters get lost in the transitions from PT4 to excel and back to Excel, but with a little patience and persistence I can build a filter including 3k usernames+!

Now back to work of fine tuning the parameters of the reports!

Thank you again for your time and help!
leviathan74
 
Posts: 84
Joined: Sun Sep 14, 2008 2:52 pm

Re: Help with filtering a player group

Postby Flag_Hippo » Thu Jul 08, 2021 12:28 pm

leviathan74 wrote:but with a little patience and persistence I can build a filter including 3k usernames+!

Thanks for the update. Another thing to note is there is a limit to the number of characters in an expression filter so if you find yourself exceeding that you can change the formatting of your expression from this:

Code: Select all
player.player_name = 'playername1' OR player.player_name = 'playername2' OR player.player_name = 'playername3'

to this:

Code: Select all
player.player_name SIMILAR TO '(playername1|playername2|playername3)'
Flag_Hippo
Moderator
 
Posts: 14505
Joined: Tue Jan 31, 2012 7:50 am

Next

Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 20 guests

cron
highfalutin