Square root

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

Square root

Postby preparac » Mon Nov 17, 2008 2:50 am

Probably a silly question. Is there a square root function available to use for custom stats?
preparac
 
Posts: 323
Joined: Thu May 15, 2008 6:23 am

Re: Square root

Postby WhiteRider » Mon Nov 17, 2008 5:32 am

There isn't a square root function that I'm aware of, but you can use the 'power' operator; ^
e.g. 3 ^ 2 = 3 to the power 2 = 9
9 ^ 0.5 = square root of 9 = 3.
WhiteRider
Moderator
 
Posts: 53972
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Square root

Postby preparac » Sat Nov 29, 2008 4:06 am

cool thanks!
preparac
 
Posts: 323
Joined: Thu May 15, 2008 6:23 am

Re: Square root

Postby Dan_Jazz_Man » Mon Dec 08, 2008 7:00 am

WhiteRider wrote:There isn't a square root function that I'm aware of, but you can use the 'power' operator; ^
e.g. 3 ^ 2 = 3 to the power 2 = 9
9 ^ 0.5 = square root of 9 = 3.

Hmm, this doesn't work. I wrote "format_number (cnt_holecards ^ 2 - 0.664, 0, false, false)" for a report, dealing with confidence
intervals, and got a warning of "expression is NOT valid".
Dan_Jazz_Man
 
Posts: 466
Joined: Sun Feb 03, 2008 5:58 pm

Re: Square root

Postby Dan_Jazz_Man » Mon Dec 08, 2008 10:10 am

Dan_Jazz_Man wrote:
WhiteRider wrote:There isn't a square root function that I'm aware of, but you can use the 'power' operator; ^
e.g. 3 ^ 2 = 3 to the power 2 = 9
9 ^ 0.5 = square root of 9 = 3.

EDIT: Hmm, this doesn't work. I wrote "format_number (cnt_holecards ^ 0.5 - 0.664, 0, false, false)" for a report, dealing with confidence
intervals, and got a warning of "expression is NOT valid".
Dan_Jazz_Man
 
Posts: 466
Joined: Sun Feb 03, 2008 5:58 pm

Re: Square root

Postby WhiteRider » Mon Dec 08, 2008 11:13 am

Possibly this doesn't work in the Statistics tab - try doing your calculation in your cnt_holecards column.
WhiteRider
Moderator
 
Posts: 53972
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Square root

Postby Dan_Jazz_Man » Tue Dec 09, 2008 8:35 am

I'm sorry, I don't understand what you mean.
I have a column in a report for showing the expected number of times a pocket pair improves on the flop, and also
left and right values of a 95% confidence interval. So here's what I want to write:
format ('{1}, {2}. {3},
format_number (cnt_holecards * 0.1175 - (cnt_holecards ^ 0.5) * 2 * 0.332, 0, false, false),
format_number (cnt_holecards * 0.1175, 0, false, false),
format_number (cnt_holecards * 0.1175 + (cnt_holecards ^ 0.5) * 2 * 0.332, 0, false, false) )

How can I do it differently?
Dan_Jazz_Man
 
Posts: 466
Joined: Sun Feb 03, 2008 5:58 pm

Re: Square root

Postby WhiteRider » Tue Dec 09, 2008 1:31 pm

I think you need to put your square root calculation in the Column "cnt_holecards" - or actually you may need to create a new column for each calculation; cnt_holecards_root for instance, where the Value Expression in the column has the ^ 0.5 added to whatever is already in the cnt_holecards column.
WhiteRider
Moderator
 
Posts: 53972
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Square root

Postby Dan_Jazz_Man » Wed Dec 10, 2008 8:26 am

This doesn't work either. I created a cnt_holecard_sqrt column and tried to write the following expression for it:
cnt_holecard ^ 0.5
PT gives a warning message of "NOT a valid SQL expression".
Dan_Jazz_Man
 
Posts: 466
Joined: Sun Feb 03, 2008 5:58 pm

Re: Square root

Postby kraada » Wed Dec 10, 2008 10:14 am

Earlier you were referring to cnt_holecards not cnt_holecard -- could this perhaps be the problem now?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Next

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

Who is online

Users browsing this forum: No registered users and 9 guests

cron