First time creating new stat

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

First time creating new stat

Postby Veinos » Fri Jan 08, 2010 2:33 pm

Hey, i'm trying to create my first new stat.
It's going to be a flop continuation bet success stat.
I need help to figure this out though. So far, i have this: cnt_f_cbet > 0 AND cnt_t_saw = 0 AND cnt_f_fold = 0 / cnt_f_cbet
This is valid but don't make any sense, since i divide a boolean by a number right?
How should i go about having a variable count (cnt_f_cbet) depending of IF those conditions are true?
And how can I compare that cnt_f_cbet when the conditions are true to the original cnt_f_cbet?
Veinos
 
Posts: 40
Joined: Tue Jan 20, 2009 5:50 pm

Re: First time creating new stat

Postby kraada » Fri Jan 08, 2010 2:38 pm

What you want to do is create a new column that counts how many times a player cbets and wins the pot right there. You can't do that just from the existing columns, you do need a new one. It should read:

cnt_f_cbet_success:
sum(if[holdem_hand_player_statistics.flg_f_cbet AND NOT(holdem_hand_player_statistics.flg_t_saw) AND NOT(holdem_hand_player_statistics.flg_f_face_raise), 1, 0])

Then on the stats tab create a new stat that's (cnt_f_cbet_success / cnt_f_cbet) * 100.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: First time creating new stat

Postby Veinos » Fri Jan 08, 2010 2:50 pm

Thanks a lot, this worked perfectly
I guess i'll have some more reading to do to fully understand how to think in sql :P
Impressive reply speed by the way! :shock:
Veinos
 
Posts: 40
Joined: Tue Jan 20, 2009 5:50 pm

Re: First time creating new stat

Postby kraada » Fri Jan 08, 2010 3:36 pm

You're welcome; it definitely takes a little bit of getting used to but trust me, it's well worth it.
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 1 guest