M range stat help - PFR

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

M range stat help - PFR

Postby chris5555 » Mon Mar 14, 2011 5:27 pm

I'm trying to build a M-range stat for PFR but PT3 says "The statement is not valid SQL" when I create the new column. I looked at the M-range tutorial and added the code with an "and" per the example, but maybe in the wrong place?

First tried to build a custom column 'cnt_p_raise_bz' from the original PFR stat:

sum(tourney_holdem_hand_player_statistics.cnt_p_raise)


Then I copied & inserted the code for the blue M range:

sum(tourney_holdem_hand_player_statistics.cnt_p_raise and (tourney_holdem_hand_player_detail.amt_before / ( tourney_holdem_blinds.amt_bb + tourney_holdem_blinds.amt_sb + (tourney_holdem_hand_summary.cnt_players * tourney_holdem_hand_player_detail.amt_ante)) > 50))

Also tried adding at the end, but no luck. Seemed like it should be good, since it's just a qualifier added on to the existing code. (?)

sum(tourney_holdem_hand_player_statistics.cnt_p_raise) and (tourney_holdem_hand_player_detail.amt_before / ( tourney_holdem_blinds.amt_bb + tourney_holdem_blinds.amt_sb + (tourney_holdem_hand_summary.cnt_players * tourney_holdem_hand_player_detail.amt_ante)) > 50)

"The statement is not valid SQL" GRRR!

The VPIP stat was so straightforward, if someone can point me in the right direction, I would appreciate it. Thank you in advance!

Chris
chris5555
 
Posts: 1
Joined: Sat Oct 17, 2009 4:42 pm

Re: M range stat help - PFR

Postby kraada » Mon Mar 14, 2011 6:25 pm

You forgot the if[] portion of the stat, and a couple of other things. Changes in bold below:

sum(if[tourney_holdem_hand_player_statistics.cnt_p_raise > 0 and (tourney_holdem_hand_player_detail.amt_before / ( tourney_holdem_blinds.amt_bb + tourney_holdem_blinds.amt_sb + (tourney_holdem_hand_summary.cnt_players * tourney_holdem_hand_player_detail.amt_ante)) > 50), 1, 0])
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