Page 1 of 1

Custom stat error - open shove button

PostPosted: Thu Feb 07, 2013 10:58 pm
by MPGrinder
I was playing about trying to make a custom stat for tracker. I wanted to get the percent of times the player has open shoved the button pre-flop.

I have made 2 stats..

cnt_times_player_could_have_shoved_button
Code: Select all
sum( if[ tourney_hand_player_statistics.flg_p_open_opp = '1' AND position = '0', 1, 0] )


cnt_times_player_could_have_shoved_button
Code: Select all
sum( if[ amt_chips - amt_bet_p = '0' AND position = '0', 1, 0] )


Then I made the stat
Open Shoves Button
Code: Select all
(cnt_times_player_open_shove_button / cnt_times_player_could_have_shoved_button) *100


When I try to use the stat I get an error..
Code: Select all
Unable to execute query......... ERROR: coulmn 'tourney_hand_sumary.id_hand" must appear in the GROUP BY clause or be used in an aggregate function.


Anyone have any ideas why this is happening?

Cheers

Re: Custom stat error - open shove button

PostPosted: Fri Feb 08, 2013 1:14 pm
by kraada
You need to use the full table reference in order for your columns to work right, so for your first column you want:

sum( if[ tourney_hand_player_statistics.flg_p_open_opp AND tourney_hand_player_statistics.position = 0, 1, 0] )

I presume your second column was supposed to be times the player did open shove the button? This definition will work better for you:

sum(if[tourney_hand_player_statistics.flg_p_open_opp and tourney_hand_player_statistics.position = 0 and lookup_actions_p.action = 'R' and tourney_hand_player_statistics.amt_p_raise_made = tourney_hand_player_statistics.amt_p_effective_stack, 1, 0])

This says you had a chance to open on the button and you made exactly one action (raise) and the size of your raise was equal to your effective stack size (aka a shove).

Re: Custom stat error - open shove button

PostPosted: Tue Feb 12, 2013 3:18 pm
by MPGrinder
kraada wrote:You need to use the full table reference in order for your columns to work right, so for your first column you want:

sum( if[ tourney_hand_player_statistics.flg_p_open_opp AND tourney_hand_player_statistics.position = 0, 1, 0] )

I presume your second column was supposed to be times the player did open shove the button? This definition will work better for you:

sum(if[tourney_hand_player_statistics.flg_p_open_opp and tourney_hand_player_statistics.position = 0 and lookup_actions_p.action = 'R' and tourney_hand_player_statistics.amt_p_raise_made = tourney_hand_player_statistics.amt_p_effective_stack, 1, 0])

This says you had a chance to open on the button and you made exactly one action (raise) and the size of your raise was equal to your effective stack size (aka a shove).


Thanks Kraada. That make sense. I come from c/c++ so haven't done much in SQL.

Unfortunately I'm still getting the same error. Do I have to use the column 'tourney_hand_summary.id_hand' somewhere in my stat as it says it must appear in the GROUP BY clause or an aggregate function?

I get the same error whether or not I use the stat function posted above, or just output either of the columns.

Cheers

Re: Custom stat error - open shove button

PostPosted: Tue Feb 12, 2013 4:17 pm
by kraada
What other stats do you have in this report? The above stats don't have any data from tourney_hand_summary in them . . .

Re: Custom stat error - open shove button

PostPosted: Tue Feb 12, 2013 11:34 pm
by MPGrinder
kraada wrote:What other stats do you have in this report? The above stats don't have any data from tourney_hand_summary in them . . .


Sorry, I had done it as a hand stat not a player stat. All works perfectly. Thanks kraada

highfalutin