Nth root stat

Discuss how to create custom stats, reports and HUD profiles and share your creations.

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Re: Nth root stat

Postby BillGatesIII » Tue May 14, 2013 5:14 am

gazavat wrote:power( cnt_avg_3B_behind, 1/(2 + substring(cash_hand_summary.str_aggressors_p from 2 for 1)::int))

It says invalid SQL

If I replace (2 + substring(cash_hand_summary.str_aggressors_p from 2 for 1)::int) with an integer, it says valid expression, so it does recognize the power function.


If you replace cnt_avg_3B_behind with a database field, will it validate?

And what are you trying to calculate? I'm puzzled :)
BillGatesIII
 
Posts: 740
Joined: Fri Dec 16, 2011 6:50 pm

Re: Nth root stat

Postby gazavat » Wed May 15, 2013 9:20 am

BillGatesIII wrote:
gazavat wrote:power( cnt_avg_3B_behind, 1/(2 + substring(cash_hand_summary.str_aggressors_p from 2 for 1)::int))

It says invalid SQL

If I replace (2 + substring(cash_hand_summary.str_aggressors_p from 2 for 1)::int) with an integer, it says valid expression, so it does recognize the power function.


If you replace cnt_avg_3B_behind with a database field, will it validate?

And what are you trying to calculate? I'm puzzled :)



I cannot replace it because the expression behind it is the division of 2 SUM expressions. Thus, it can only be done as a stat expression using 2 columns. I am forced to do the calculations here as the power function seems not to be recognized in the stat expression field.

Regarding what the stat does, I have a custom stat how often the RFI player faces a 3bet. For example, BTN raises first in and faces a 3bet 20% of the time. This is the result of both SB and BB 3betting. Assuming they use identical 3bet ranges, I am trying to calculate what is the 3bet range of each one. In the particular example it is 10.56% 3bet range for each one so that the BTN gets 3bet a total of 20% by either.

However, this is not too relevant to the issue at hand since comes down to my inability to use the power function within a stat expression and I cannot do the necessary calculations within a column expression without referencing other columns.
gazavat
 
Posts: 88
Joined: Sat Feb 05, 2011 2:04 am

Re: Nth root stat

Postby gazavat » Wed May 15, 2013 9:27 am

gazavat wrote:
kraada wrote:(2) This is due to the way that the columns have to be converted to work as SQL queries. However, if you're going to do that what you want to do is just create your two sum() pieces as different columns, then divide in the Stat's value expression itself (just as most of the built in stats do).

(3) I believe this is due to the comma which is parsed as being a part of the if[] statement.


3) I do not see any if statement?

Here is the issue:

I cannot validate any use of the POWER function within the statistics expression. For some reason some versions validate within the Column expressions. I have no explanation for that and have no idea if it makes sense. However, it prevents me from using the column and stat expressions as intended. That is the only reason I try using the Power function within a column expression. I would much rather create a column for each part of the equation and just do the power expression as a stat using column, but I cannot validate it. Help is highly appreciated.



Bump for Kraada.

Why is it that I cannot use the power function within the statistics expressions? Any workarounds for that? Can variables help my situation in any way?
gazavat
 
Posts: 88
Joined: Sat Feb 05, 2011 2:04 am

Re: Nth root stat

Postby kraada » Wed May 15, 2013 12:12 pm

The stat doesn't perform any SQL - power() is an SQL function and thus must be done in a column. I'm not certain why it's not working but if you could please restart PT4 using the logging enabled link on your Start Menu, reproduce this problem and then report it via our support system with the log file - that will help us figure out what is going on here and get it fixed for you. You can find that file by clicking File --> Show User Data Folder in the main PT4 window - the file we need is the text file called PokerTracker4 that is in that folder. That will show us the exact query we're sending and we'll be able to diagnose the issue more fully then.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Nth root stat

Postby gazavat » Mon May 20, 2013 4:49 pm

kraada wrote:The stat doesn't perform any SQL - power() is an SQL function and thus must be done in a column. I'm not certain why it's not working but if you could please restart PT4 using the logging enabled link on your Start Menu, reproduce this problem and then report it via our support system with the log file - that will help us figure out what is going on here and get it fixed for you. You can find that file by clicking File --> Show User Data Folder in the main PT4 window - the file we need is the text file called PokerTracker4 that is in that folder. That will show us the exact query we're sending and we'll be able to diagnose the issue more fully then.


1 Are you saying that the power() should not work in a stat expression or you want me to try it out and send the log?

2 If I can only use the power() in a column expression and I need to run it on a division of 2 sum() expressions, what am I supposed to do?
gazavat
 
Posts: 88
Joined: Sat Feb 05, 2011 2:04 am

Re: Nth root stat

Postby kraada » Mon May 20, 2013 5:05 pm

All PostgreSQL functions must be called in columns - stats don't have access so it'd have to be in a column. I suspect the problem is not with power() but with the comma that is used as part of power(). Either way, please try it out and send us some logs because we really ought to be able to escape things to allow for commas in properly used in columns.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Previous

Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 29 guests

cron
highfalutin