Known tourney wins

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

Known tourney wins

Postby Parket » Sun May 15, 2011 12:05 pm

I've started playing around a bit with the statistics. As a simple start, I want to calculate the known Net Win and ROI of a player. By that, I mean the Net Win and ROI based on known tournament results, ignoring the records where you don't know the player's finish (this is indicated by finish = 0). A lot of sites don't provide tournament summaries so you might have players in your tournament for which the finish is not know.
Now, this is not working yet.

1. First, I thought that the custom statistics are stored in the database. I have one shared database with 2 PT3 clients on my netbook and desktop respectively. I created the custom stats on my netbook, but when I open PT3 on my desktop there is no sign of the custom stats. Is that normal ?

2. I did all actions in the 'Holdem Tournament Tournaments' section. Created a custom column 'amt_buyin_ttl_known' which is a copy of 'amt_buyin_ttl' but has the if inside the sum : sum(if[tourney_holdem_results.val_finish>0, tour...copiedfromoriginal...addon, 0]). So basically the if says that if I don't have a finish for the player, I set his buyin to 0 as well.
Then I created a custom variable 'amt_net_known' copied from 'amt_net' which uses 'amt_buyin_ttl_known' instead of 'amt_buyin_ttl'.
Finally, I created 2 custom stats 'Net Won Known' and 'ROI Known' which again are identical to the originals but that use the _known variants instead.
Now, apparently this is not working. The stats that I can now get on the Winnings tab are there, but they are identical to their originals. So it's as if the if-statement in the sum is not working.
What am I doing wrong here ?

3. Finally, how do I include this stat (provided I can get it to work) in my HUD ? I noticed that I can't even select the built-in stats like Net Won or ROI.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Known tourney wins

Postby kraada » Sun May 15, 2011 12:33 pm

(1) Custom statistics are stored on your computer. If you want to move them from one machine to the other you need to export them from the first machine and reimport them on the other machine.

(2) That's not going to work because in the Hand Player Statistics section the data sums over each hand played - so you end up getting the wins multiplied by the number of hands played which overflows our buffers. We're looking into getting ROI and other related statistics into the HUD but this method won't quite work. Hopefully we'll have some progress on this front before too long though.

(3) These stats aren't available because they're in different stat sections - only the stats in the Player Statistics section are available for use in the HUD. For more on custom statistics and statistics sections, please see the Tutorial: Using Custom Statistics and Reports.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Known tourney wins

Postby Parket » Sun May 15, 2011 1:31 pm

Thanks for the answers...

kraada wrote:(2) That's not going to work because in the Hand Player Statistics section the data sums over each hand played - so you end up getting the wins multiplied by the number of hands played which overflows our buffers. We're looking into getting ROI and other related statistics into the HUD but this method won't quite work. Hopefully we'll have some progress on this front before too long though.


...however no clue what you are talking about here. Hand Player ? Note that I'm just referring to the Custom Stats functionality. It has several groups of stats, including overal tournaments stats. The tabs already have the built-in stats as read-only entries. It includes stuff like ROI, 1st Finishes,... from which I based my custom statistic. The 1st Finishes shows how to use an if-statement on val_finish to check the finish for each tournament. ROI shows how to divide overall win by overall buy-in.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Known tourney wins

Postby WhiteRider » Sun May 15, 2011 4:43 pm

I think kraada must have misread which section you are using. What you're doing sounds reasonable, and I can't see from this why it wouldn't work - I guess you're definitely looking at someone who has 0 place (missing results) for some tournaments which have a known buy-in (so that you should see a difference)?
If you make a Backup of the default Optional Files (no databases) and attach it to a Support ticket I'll check out your stats. Please include a link to this thread as a reference, and then post your ticket number here.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Known tourney wins

Postby Parket » Tue May 17, 2011 5:35 am

Ok, will have a look later today/this week.

Still have a question on item 1. I recall posts about the limit on the number of columns in the database and that that adversely affects some people's custom stats. So how are these custom stats exactly stored ? Is it a mix of client side and database ? What if I then recreate the same statistic again on the 2nd PT3 client ? Will it create another extra column in the database, and thus make the max.columns problem even worse ?
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Known tourney wins

Postby kraada » Tue May 17, 2011 9:08 am

The data about the statistic itself is stored in a .pt3 file on your computer. The data used to calculate the statistic is stored in the database. When you update the cache we add up the data needed to calculate that stat for each player in your database - which is how we can get the stat information so quickly at the table.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Known tourney wins

Postby Parket » Tue May 17, 2011 10:00 am

Ok thanks. Seems like I misunderstood in the past. I thought that it was the actual new statistics data itself that was then precomputed and added to the database, but instead (if I understand correctly) it is the built-in statistics needed for the calculation of the new stats that gets populated in the cache to speed up the calculation of the custom stats ?
So this also means that sharing the same custom stats across different PT3 clients shouldn't adversely influence the database disk-usage or performance ?

BTW, it would be a great improvement if these custom stats (or even just their definition) were somehow stored in the database instead of at client side. I assume that anyone who shares his database across different clients would always like to have his custom stats available in all clients. The stats are more related to the actual data than they are related to the client application imho.
AFAIK there are already other settings that are stored in the database, which make less sense than the statistics. E.g. if I recall correctly, the current Filter on viewing the database is stored in the database, not the client. E.g. if on my desktop I set filter to This Year to see my tournament results this year, and later I open PT3 on my netbook the Filter will also already be This Year.

Maybe good as a feature request for the dev guys, although I realize I'm probably just one of the few who uses one database with multiple clients. I might look into the same trick that I used to share the HUD settings across my clients: use Windows symbolic links to share the config files across the PT3 clients. Changing the stats in one client would immediately reflect in all clients as they share the same files.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Known tourney wins

Postby kraada » Tue May 17, 2011 10:07 am

I'll pass this suggestion on for you, but I suspect it's fairly unlikely that we would look to make this change in the near future.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Known tourney wins

Postby Parket » Wed May 18, 2011 6:03 am

Ok, I managed to get my custom statistics working.
The problem was that apparently, you have to specify it twice in the Statistics tab. You have a Definition tab and you have a Format tab. I only had the calculation in the Definition tab. The Format tab still had the original Net Won resp. ROI expressions from which I copied the new stats.

Q1: why do we need to enter our expresssions twice ? Or maybe even 3 times as there is also a Summary Expression as well (but it turned out to be empty for the built-in Net Won and ROI, so I left it like that).
Q2: What is the difference between Columns and Variables ? I noticed that you can just use the same expressions in both, so I'm a bit clueless as to when you need to define a Column and when you need to define a Variable.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Known tourney wins

Postby kraada » Wed May 18, 2011 8:53 am

(1) If you use the format expression /%.2f (which you can see in many default stats) it will give you the value expression calculated to 2 decimal places. You can choose to format the format expression however you like though if you prefer something else.

(2) Columns are used to get data from the database directly. Variables are used when getting data that is otherwise not available in the database. For the most part, you want to build new columns not new variables.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Next

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

Who is online

Users browsing this forum: No registered users and 0 guests