Color ranges with Strings

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

Color ranges with Strings

Postby js2002 » Fri Sep 19, 2008 6:30 am

Hi,

I built the Stat "Hands played with k-notation" and my color ranges don´t work correct, because when cnt_hands > 999 the Stat takes the value / 1000 and appends a 'k'. So its no "int" anymore, so a "string" The defined color range ( doesnt matter wheater defined in "configure stats" or in the hud setup) match if the value stays below 1000. When it get > 999 the text of the stat ist white again.
js2002
 
Posts: 1502
Joined: Fri Feb 15, 2008 5:44 am
Location: Germany

Re: Color ranges with Strings

Postby WhiteRider » Fri Sep 19, 2008 6:43 am

I would have thought it would use the value in the stat's 'Value Expression' field and ignore the formatting.
Ah, are you adding the "k" in the Column you build, rather than in the Statistic?
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Color ranges with Strings

Postby js2002 » Fri Sep 19, 2008 7:35 am

WhiteRider wrote:I would have thought it would use the value in the stat's 'Value Expression' field and ignore the formatting.
Ah, are you adding the "k" in the Column you build, rather than in the Statistic?


if( cnt_hands>999 , format( '{1}k' , format_number((cnt_hands / 1000) , 1 , false , false)) , cnt_hands )

No not in the column. I use standard cnt_hands. I see that i have the exp above in the definition of the stat and the same in the format. I ll try to get it out there a see if it still works.
js2002
 
Posts: 1502
Joined: Fri Feb 15, 2008 5:44 am
Location: Germany

Re: Color ranges with Strings

Postby js2002 » Fri Sep 19, 2008 8:17 am

deleted the exp and let cnt_hands in there but the color conditions / ranges dont work !

http://rapidshare.com/files/146573229/H ... 3stat.html could you test at your PC ?
maybe it doesn´t work because I updated the value and PT3 dit not regocnize that.
js2002
 
Posts: 1502
Joined: Fri Feb 15, 2008 5:44 am
Location: Germany

Re: Color ranges with Strings

Postby WhiteRider » Fri Sep 19, 2008 12:16 pm

I think you will need to at least re-start the HUD to get it to notice the change - and possibly rebuild the cache, although I don't think this should be necessary.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Color ranges with Strings

Postby js2002 » Fri Sep 19, 2008 3:24 pm

...did this before I posted.
js2002
 
Posts: 1502
Joined: Fri Feb 15, 2008 5:44 am
Location: Germany

Re: Color ranges with Strings

Postby WhiteRider » Fri Sep 19, 2008 5:37 pm

Sorry - I kind of skim-read your reply - I've downloaded your stat now, and I'll have a play with it tomorrow.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Color ranges with Strings

Postby WhiteRider » Sat Sep 20, 2008 6:52 am

OK, I'm seeing the same as you.
I'll create a ticket about this - I think it ought to be using the 'Value Expression' when evaluating colour ranges (and anything else for that matter).
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Color ranges with Strings

Postby js2002 » Sat Sep 20, 2008 8:44 am

WhiteRider wrote:OK, I'm seeing the same as you.

thx


I'll create a ticket about this - I think it ought to be using the 'Value Expression' when evaluating colour ranges (and anything else for that matter).

Huh? baby english plz!

js2002
 
Posts: 1502
Joined: Fri Feb 15, 2008 5:44 am
Location: Germany

Re: Color ranges with Strings

Postby WhiteRider » Sat Sep 20, 2008 9:57 am

I just meant this:

WhiteRider wrote:I would have thought it would use the value in the stat's 'Value Expression' field and ignore the formatting.


It seems to be using the value from the Format tab (which includes the formatting, so uses the string), rather than the Definition tab (which doesn't).
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Next

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

Who is online

Users browsing this forum: No registered users and 1 guest