cnt_players problem...

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

cnt_players problem...

Postby Duppy81 » Wed Jan 28, 2009 6:01 am

Under the section "Holdem Cash Player Statistics" I created a column called "cnt_players" and defined it as follows:

Code: Select all
holdem_hand_summary.cnt_players


This validated correctly.

Now, I created a Statistic (in the statistics tab) called "score" and input this under Value Expression:

Code: Select all
if (cnt_players < 7, 1, 0)


This validated correctly.

Now, in Table Tracker I added the new statistic and searched for a bunch of short handed and full ring tables. If this works correctly all players on short handed tables should receive a score of "1" and all players on full ring tables should receive a score of "0". For some reason it's not working though! When I scan for the tables I just get a error in the Table Detail window of each table, stating:

Unable to load query into report. Reason: Attempting to access a null pointer (class ResultSet


I don't get it. Why isn't this working and why am I getting this error? What am I missing here?

Thanks!
Duppy81
 
Posts: 26
Joined: Fri Jan 25, 2008 12:39 pm

Re: cnt_players problem...

Postby WhiteRider » Wed Jan 28, 2009 7:51 am

It doesn't work quite like that.
It's a bit tricky to explain, but a column in 'holdem cash player statistics' builds its stats by going through each hand for the player, so just adding holdem_hand_summary.cnt_players doesn't make sense - you need to add something that works for all hands.
So you need to do the SUM in the column, not the stat.

It looks like you want to build a stat that will show whether or not a player is active at a 6-max table, but what you're [not quite] doing would tell you whether or not they had ever played at a table with less than 7 players.

The way to do what you are trying to do is to create a column:
cnt_hands_played_shorthanded = sum( if[ holdem_hand_summary.cnt_players < 7, 1, 0 ] )
This will count how many hands the player played with less than 7 players.

Then your Statistic would be
if ( cnt_hands_played_shorthanded > 0, 1, 0 )
Or you could make it a boolean stat and just use
cnt_hands_played_shorthanded > 0
..and format expression:
format_bool( cnt_hands_played_shorthanded > 0, 'check' )

However, as I said - this will only tell you if the player ever played at a table with less than 7 players.
If you want to know whether they ever played at a 6-max table I'm not sure you can do that without explicitly checking every limit using "holdem_hand_summary.id_limit".
There isn't a specific 'table size' field.

If I've misunderstood what you are trying to do, please explain..
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: cnt_players problem...

Postby Duppy81 » Wed Jan 28, 2009 8:20 am

WhiteRider wrote:If I've misunderstood what you are trying to do, please explain..


I've written two seperate fishscores, one for full ring and one for short handed. Now I can select one of two fishscores and use them in Table Tracker. So, if I want to play full ring I'll use the full ring fishscore and if I want to play short handed I'll use the short handed fishscore. I can use one of the two without any problems.

Now I'm trying to combine the two different scores, so I can scan for short handed and full ring tables at the same time. The idea is that the tables are being recognized as short handed or full ring and consequently the right fishscoring is used. A 35 vpip player at short handed isn't the same as a 35 vpip player full ring and therefor should receive different scores.

I hope you understand what I'm trying to do here. Anyways thanks for your response so far (in the other thread as well), I'm gonna play with that some.
Duppy81
 
Posts: 26
Joined: Fri Jan 25, 2008 12:39 pm

Re: cnt_players problem...

Postby Duppy81 » Wed Jan 28, 2009 8:34 am

WhiteRider wrote:However, as I said - this will only tell you if the player ever played at a table with less than 7 players.


Ok, your code works fine, I'm getting somewhere now :). However, like I explained in my previous post, I'm not trying to determine wether the player has ever played at a table with less then 7 players, I want to determine on what size of table the player is playing right now, so at the moment of the Table Tracker scan. If he is at a table with 7 or more players, I want to use my fisscoring for full ring players on the player, if it is at a table with 6 or less players I want to use my fishscoring for short handed players on the player.

Hope that makes sence.
Duppy81
 
Posts: 26
Joined: Fri Jan 25, 2008 12:39 pm

Re: cnt_players problem...

Postby kraada » Wed Jan 28, 2009 12:12 pm

I see what you're trying to do, and I think you should be able to do it.

The first thing you'd need to do is to click the Configure button on the bottom left of the TableTracker window. Check "Stats from Current Limit Only".

Now, you'll want to create two separate stats for 6-max Fishscore and 9-max Fishscore. In the 6-max fish score you'll want to make sure you have 6 or fewer players and 9 max fish score 7 or more players.

Add both scores to the table tracker report. Now, since we're only using stats from the current limit there will be a n/a in the full ring fishscore for current 6-max players, and vice versa if they're playing full ring.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: cnt_players problem...

Postby Duppy81 » Thu Jan 29, 2009 4:48 am

Yes, I thought of that as well and that shouldn't be a problem. However the fishscores are weighted against eachother, in other words, they are compatible. They are designed to be able to see wether it's better to sit at a short handed or full ring table. In theory, if a short handed table receives a score of 6 and a full ring table receives a score of 5 it's usually better for me to sit at the short handed table. So, to get a list of softest tables it would be nice if the fishscores of both short handed and full ring tables are in the same column, and that's what I'm trying to do.
Duppy81
 
Posts: 26
Joined: Fri Jan 25, 2008 12:39 pm

Re: cnt_players problem...

Postby Duppy81 » Thu Jan 29, 2009 5:47 am

kraada wrote:In the 6-max fish score you'll want to make sure you have 6 or fewer players and 9 max fish score 7 or more players.


How exactly would you do this?
Duppy81
 
Posts: 26
Joined: Fri Jan 25, 2008 12:39 pm

Re: cnt_players problem...

Postby kraada » Thu Jan 29, 2009 12:05 pm

I explained my thinking via e-mail but in case anybody else reading this is curious:

Kraada via e-mail wrote:Here's how I'd set it up, in theory, I haven't written any fish scores that I've ever liked, so I'll leave the details to you:

I'd set up two non-overlapping ranges for the fish scores so that when you mash them together you can tell whether the score is based on 6M hands or FR hands. Remember, TT will only use the stats from the limit they are currently sitting at to give you data.

For example, let's say we decide that we need 99 fish score values, where 0 is super fishy, and 99 is very sharky, and you use whatever rubric you want to find values in between. Then what I'd do is have the score set up to assign values 1 - 99 for 6-max and 1000 to 9900 to full ring, and the final score stat to just add the two values together. This way if you're looking at the player in the PT3 window you might see him as a 6740 or something ("better" in full ring than 6max). However, in TT it'll only use the stats for the limits of the table the guy is currently sitting at -- so you'd only see 6700 or 40. Then with this setup, you can quickly tell which is FR and which is 6m - FR is > 1000, 6m < 100, which should be pretty easy to just see.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests