Keep getting a "value expression NOT valid")

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

Keep getting a "value expression NOT valid")

Postby Jayman8667 » Sat Aug 21, 2010 6:50 pm

I'm trying to add a simple stat "Won at showdown when bet river". There is a stat similar to this already but it includes raising which I want removed from the stat. There is a huge difference between someone betting the river & someone raising a river bet. Besides there is already a Won at showdown when raise river.

The code I've tried:

(cnt_r_bet_wtsd_won / cnt_r_bet_wtsd) * 100
it didn't work.
I then tried: (cnt_wtsd_won_when_r_bet / cnt_r_bet_hands)*100
it also didn't work. I've tried about 20 different variations and each one seems to be invalid.

Can someone please help me, I'm clueless with this type of thing and have spent more then 2 hours reading over this stuff and I'm about to start pulling tufts of hair out in frustration :x
Jayman8667
 
Posts: 12
Joined: Wed Aug 18, 2010 8:21 pm

Re: Keep getting a "value expression NOT valid")

Postby Jayman8667 » Sun Aug 22, 2010 2:29 am

I have continued playing around the code and finally got it saying valid, but I'm not sure if it works.

For Column:
sum( if[ (holdem_hand_player_statistics.flg_r_bet) and holdem_hand_player_statistics.flg_won_hand and holdem_hand_player_statistics.flg_showdown, 1, 0])

Statistics:
(cnt_wtsd_won_when_r_bet / cnt_wtsd_won_when_r_bet) * 100

Does this look right? I want the stat "Won at SD when bet river"
Jayman8667
 
Posts: 12
Joined: Wed Aug 18, 2010 8:21 pm

Re: Keep getting a "value expression NOT valid")

Postby WhiteRider » Sun Aug 22, 2010 4:54 am

Your column looks good, but that's only half of the calculation.
Your column counts the times that the player won at showdown when they bet the river, but if you divide that by itself (cnt_wtsd_won_when_r_bet / cnt_wtsd_won_when_r_bet) then you will always get 1.
You need another column to count the "opportunites".
In this case I guess you want to know the total number of times the player bet the river and went to showdown?
That would be:


cnt_wtsd_when_r_bet =
sum( if[ (holdem_hand_player_statistics.flg_r_bet) and holdem_hand_player_statistics.flg_showdown, 1, 0])

Then your stat would be:

(cnt_wtsd_won_when_r_bet / cnt_wtsd_when_r_bet) * 100
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


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

Who is online

Users browsing this forum: No registered users and 0 guests