Custom filter in hand reporter vs group of player

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

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Custom filter in hand reporter vs group of player

Postby Mallaina » Thu Mar 16, 2023 12:11 pm

Hello, I was rereading this thread, https://www.pokertracker.com/forums/vie ... er#p368365
And he is close to what I am looking for, but I intend to do it against a group of players,

I tried this code, with a specific player in a hands report and I entered this code with a specific player, in the filters.edit existing expression filters section and perfect.

tourney_hand_player_statistics.id_hand in (SELECT thps.id_hand from tourney_hand_player_statistics thps, player p where thps.id_player = p.id_player and p.player_name = 'VILLAIN')

Now I ventured and replaced Villan with RegularPlayerList.player and the query did not validate. It stays like this

tourney_hand_player_statistics.id_hand in (SELECT thps.id_hand from tourney_hand_player_statistics thps, player p where thps.id_player = p.id_player and p.player_name = RegularPlayerList.player)

RegularPlayerList is a view that I have created inside the database that pt4 created in potgress, and player_name is the column where it stores the names of the regulars that I decided.

This view has more columns, like id.player and id.site, all the columns are populated through a function, which I feed with the players' names and if the players are in the database, then it adds them to the list. player list, with the real id of the BD and the real Id.site to which that nick belongs.

Final question. How can I make a filter query, so that it shows me hands in which I was at the same table, and at least one of the players in the playerList?

Thanks for reading my post
Mallaina
 
Posts: 19
Joined: Sat May 12, 2012 2:45 pm

Re: Custom filter in hand reporter vs group of player

Postby Mallaina » Thu Mar 16, 2023 12:41 pm

Before this post, I already found a method, but it does not go through the view that creates potgress, which is not a more comfortable and efficient method, the code that does work is to nest with an or, all the nicknames that I want, and I can do it manually that is not very heavy, or make a script that generates the final code for me, I put here my solution regarding the structure.

Initial structure a single player:
tourney_hand_player_statistics.id_hand in (SELECT thps.id_hand from tourney_hand_player_statistics thps, player p where thps.id_player = p.id_player and p.player_name = 'NickPlayer1')

Structure for several players:

tourney_hand_player_statistics.id_hand in (SELECT thps.id_hand from tourney_hand_player_statistics thps, player p where thps.id_player = p.id_player and (p.player_name = 'NickPlayer1' OR p.player_name = 'NickPlayer2' OR ... ))

So if someone would know how to make the structure lighter and using the view that you believe in potgress, I will be eternally grateful and surely God will reward you with a good mug of beer
Mallaina
 
Posts: 19
Joined: Sat May 12, 2012 2:45 pm

Re: Custom filter in hand reporter vs group of player

Postby Flag_Hippo » Thu Mar 16, 2023 1:25 pm

If you want a query shorter in length you can use this format:

Code: Select all
tourney_hand_player_statistics.id_hand in (SELECT thps.id_hand from tourney_hand_player_statistics thps, player p where thps.id_player = p.id_player and p.player_name SIMILAR TO '(NickPlayer1|NickPlayer2|NickPlayer3|NickPlayer4|NickPlayer5)')
Flag_Hippo
Moderator
 
Posts: 14440
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 23 guests

cron