Referencing one column from another, within player statistic

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

Re: Referencing one column from another, within player statistic

Postby WhiteRider » Fri Nov 21, 2008 11:15 am

Would it be feasible to reference the text of the other column definition?

So for example the "cnt_p_ccall_opp" column in Holdem Cash Player Statistics (HCPS) could say:
"if [ HCH.column.flg_p_ccall_opp.text, 1, 0 ]
(or whatever), where HCH = Holdem Cash Hand;
..and then when the column is parsed to be constructed the "HCH.column.flg_p_ccall_opp.text" could be replaced with the text of the definition of the Holdem Cash Hand column "flg_p_ccall_opp".
Rather than the rather long-winded:
sum( if[ NOT(NOT(holdem_hand_player_statistics.flg_p_face_raise) OR (holdem_hand_player_statistics.flg_p_limp) OR (holdem_hand_player_statistics.flg_p_first_raise)) AND (holdem_hand_player_detail.amt_blind=0), 1 , 0 ] )
For a Custom Stat, if we change the definition of the HCH column, this would automatically change the HCPS stat too, which would be nice.

On a related note; I'd like to be able to do the same kind of thing for the Stats tab. Quite often we want to use what we enter in the "Value Expression" field on the Format tab too, and currently we have to retype the expression. I'd like to just be able to enter (for example) "{value}" and have it parsed for me.
e.g. HCPS:$/100
Value Expression = "amt_won / (cnt_hands / 100)"
Format Expression = "format_money(amt_won / (cnt_hands / 100), true)"
It would be simpler and clearer to enter:
Format Expression = "format_money({value}, true)"
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Previous

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

Who is online

Users browsing this forum: No registered users and 0 guests