Constants for use in Columns for Custom Stats?

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

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Constants for use in Columns for Custom Stats?

Postby fizbin » Fri Feb 01, 2013 3:29 am

I want to have a variable that can be set as a parameter constant for Custom Stats, for example var_vpip_very_high might be 61.9. I've done that in the Variables tab, and the parameter/variable can be used in equations in the Stats tab, so that's great. However, when I try to use that parameter/variable in equations in the Columns tab, it says the statement is not valid SQL. Is it impossible for columns to read variables or is there a special incantation I need to use? If it is impossible, then is there any disadvantage to moving the formula from the Columns tab to the Stats tab, other than cluttering up the user interface for selecting stats?
fizbin
 
Posts: 87
Joined: Tue Jan 08, 2013 5:25 am

Re: Constants for use in Columns for Custom Stats?

Postby kraada » Fri Feb 01, 2013 9:23 am

Columns can't read from variables, only Stats can. However, columns can read from other columns, so you should be able to do this in a column and have it work out properly.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Constants for use in Columns for Custom Stats?

Postby fizbin » Sat Feb 02, 2013 1:17 pm

Thanks, but if I want to create a constant, let's say 42, it says invalid SQL if I just write 42 as the expression in the Column Tab. (It works under the Variable Tab, though.) The only way I've found to do it under the Column tab is to write something like:

if[ cnt_hands >= 0, 42, 0 ]

The condition is always true, so then I always get my 42. It wants a field name, so a simple "42" won't work, and the following doesn't work either:

if[ 1 = 1, 42, 0 ]

Is there a better way?

If I create about 70 new columns to hold parameters, would it negatively impact the overall SQL performance?

I also have a question about efficiency. If you use a Column repeatedly in a Stat color definition, the Column is only evaluated once, correct? And if you use a Stat in a Stat color definition, the Stat is reevaluated every time it's used, correct? For example,

"#VPIP# >= 20 AND #VPIP# < 30" as a color condition would result in the VPIP stat being computed twice, whereas if you happened to have a "vpip" column, then you could write "vpip >= 20 AND vpip < 30" and this would require less computation, right? The example is trivial, but the color conditions I actually used brought my machine to its knees, so I'm wondering if I can create Columns to basically hold some of my Custom Stat information, so that less information needs to be (re)computed for each color condition.
fizbin
 
Posts: 87
Joined: Tue Jan 08, 2013 5:25 am

Re: Constants for use in Columns for Custom Stats?

Postby WhiteRider » Sun Feb 03, 2013 7:13 am

I'm not aware of a better way to set up your constants.

I wouldn't expect the data to be retrieved multiple times for colour conditions however you do it, because PostgreSQL should handle that, although I don't know for sure. I'll see if I can get a better answer from the development team.
WhiteRider
Moderator
 
Posts: 54018
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 50 guests

cron
highfalutin