positional PF AF

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

positional PF AF

Postby amre » Mon Dec 15, 2008 6:07 pm

Hi, just trying to make a stat I obtained from the repository positional. This is the stat; let's say I want it for UTG and HJ so positions 2 and 3 in 6-max.

((cnt_f_bet + cnt_f_raise + cnt_t_bet + cnt_t_raise + cnt_r_bet + cnt_r_raise)/(cnt_f_call + cnt_f_fold + cnt_f_bet + cnt_f_raise + cnt_f_check + cnt_t_call + cnt_t_fold + cnt_t_bet + cnt_t_raise + cnt_t_check + cnt_r_call + cnt_r_fold + cnt_r_bet + cnt_r_raise + cnt_r_check))*100

So do I just add something like below to the value window or do I have to create positional counts for all the cnt_f_bet things?

if[holdem_hand_player_statistics.position = 2,1,0 OR 3,1,0]

Thanks in advance!
amre
 
Posts: 6
Joined: Sat Nov 29, 2008 1:28 am

Re: positional PF AF

Postby amre » Mon Dec 15, 2008 10:17 pm

Might have found a bug; I created 2 columns, cnt_f_bet and cnt_f_bet_EP. I then created statistics which were equal to these columns. All were found syntactically correct by the validate button, but I received an error code on running. Here is what I coded for them.

cnt_f_bet
sum(if[holdem_hand_player_statistics.flg_f_bet, 1, 0])

cnt_f_bet_EP
sum(if[holdem_hand_player_statistics.flg_f_bet AND holdem_hand_player_statistics.position=3, 1, if[holdem_hand_player_statistics.flg_f_bet AND holdem_hand_player_statistics.position=2, 1, 0]])

error message:
unable to execute query ...LONG block of query stuff... Reason: Fatal Error ($ERROR: column "holdem_hand_summary.id_hand" must appear in the GROUP BY clause or be used in an aggregate function.
amre
 
Posts: 6
Joined: Sat Nov 29, 2008 1:28 am

Re: positional PF AF

Postby shalder » Tue Dec 16, 2008 2:18 am

Both of your bottom functions execute just fine.
Check to see if u don't have some other custom stat in the report w/ an error in it.

Specifically look for a stat that references "holdem_hand_summary.id_hand"
Alternatively, look inside the 2 functions and see if u didn't add some code below a bunch of white space, that u aren't seeing.
shalder
 
Posts: 51
Joined: Sat May 31, 2008 9:16 pm

Re: positional PF AF

Postby kraada » Tue Dec 16, 2008 1:34 pm

Your queries in the second post look good, in the first post it should be:
sum(if[holdem_hand_player_statistics.position = 2 OR holdem_hand_player_statistics.position = 3,1,0]) if you're trying to count how many hands you had in those positions.

Another option is to create a column that just sees when you're in early position and reference that (it makes for easier readability).

Call it, say, flg_ep_6m, and define it as:
if[ holdem_hand_player_statistics.position = 3 or holdem_hand_player_statistics.position = 2, 1, 0 ]

Then you could create any positional stat by adding "and flg_ep_6m = 1" - as that will check that the positions match what you want.

(And if you create flg_mp_6m and flg_lp_6m then you can easily duplicate your other stats to middle and late position, also.)
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 2 guests