Number v Percentage

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

Number v Percentage

Postby ccpsc » Thu Dec 04, 2008 4:57 pm

How do I create a stat to show the number of times an action was taken out of how many opportunities instead of a percentage and get it to display correctly. I want to create a 3bet stat eg: 5/22 because PT3 only seems to have percentages.
ccpsc
 
Posts: 32
Joined: Wed Mar 19, 2008 7:45 pm

Re: Number v Percentage

Postby kraada » Thu Dec 04, 2008 5:15 pm

You'll be able to find the information you're looking for in this post.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Number v Percentage

Postby ccpsc » Fri Dec 05, 2008 5:27 am

Thanks for that but I'm having a problem I created a stat called "3Bet Preflop Count" with the Value Expression: cnt_p_3bet / cnt_p_3bet_opp and validated it. I formated it with the Format Expression: format( '{1}/{2}', format_number(cnt_p_3bet, cnt_p_3bet_opp)) and validated it. But it would not display, it came up with an error. What am I doing wrong?
ccpsc
 
Posts: 32
Joined: Wed Mar 19, 2008 7:45 pm

Re: Number v Percentage

Postby WhiteRider » Fri Dec 05, 2008 5:33 am

You're not entering enough parameters in the format_number part.
It needs to be like this:
format_number(cnt_p_3bet,1,false,false)
and
format_number(cnt_p_3bet_opp,1,false,false)
..or however many decimal places you want.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Number v Percentage

Postby ccpsc » Fri Dec 05, 2008 2:15 pm

That didn't work I am doing something wrong. I don't want any decimal places and it should display like this eg; 4/16. Could you show me the expression exactly how it should be entered?
ccpsc
 
Posts: 32
Joined: Wed Mar 19, 2008 7:45 pm

Re: Number v Percentage

Postby WhiteRider » Fri Dec 05, 2008 7:02 pm

format( '{1}/{2}', format_number(cnt_p_3bet,0,false,false), format_number(cnt_p_3bet_opp,0,false,false) )
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Number v Percentage

Postby ccpsc » Fri Dec 05, 2008 7:33 pm

Thanks that worked great. Can you tell me what the "0, false, false" in the expression stands for?
ccpsc
 
Posts: 32
Joined: Wed Mar 19, 2008 7:45 pm

Re: Number v Percentage

Postby WhiteRider » Sat Dec 06, 2008 5:24 am

You can find this kind of thing out within PT3 - click on the 'Insert' link and going to the Functions tab.
format_number is ( value, decimals, commas, color )
i.e. the value you want to format, the number of decimal places to show, whether to show commas, whether to color red or green for negative or positive.
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 8 guests