Sorry, I thought you wanted something more abstract.
If you want to assign a color to a stat based on that stat's value you want to use the Color Ranges section in the Hud Editor as explained in this guide.
Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators
(substr(string_agg(CASE
WHEN
tourney_hand_player_statistics.position = 8
THEN (
CASE
WHEN tourney_hand_player_statistics.flg_p_3bet AND NOT tourney_hand_player_statistics.enum_allin='P'
THEN '3B'
WHEN tourney_hand_player_statistics.flg_p_3bet AND tourney_hand_player_statistics.enum_allin='P'
THEN '3BS'
WHEN tourney_hand_player_statistics.position = 8
and lookup_actions_p.action = 'X'
THEN 'X'
WHEN tourney_hand_player_statistics.flg_p_first_raise AND NOT tourney_hand_player_statistics.flg_p_open_opp
THEN 'ISO'
WHEN tourney_hand_player_statistics.flg_p_fold
THEN 'F'
WHEN tourney_hand_player_statistics.position=8 AND tourney_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action='C' AND tourney_hand_player_statistics.val_p_raise_aggressor_pos=9
THEN 'C'
ELSE '0'
END
)
ELSE NULL
END, ',' ORDER BY tourney_hand_player_statistics.date_played DESC), 01, 20))
BillGatesIII wrote:*Disclaimer: The following answer is by heart
The ,01 ,20) in your code means it returns the first twenty characters of the recorded actions. But because for instance ISO has three characters and X has one, you don't know how many actions there will be in the string.
If you make the individual actions the same length, for example one character, the string will something look like this.
F,X,I,C,0,0,F,F,F,0,
So it wil return the last ten actions.
To get the one but last action (X in my example) change ,01, 20) to 03, 01).
More information:
https://www.postgresql.org/docs/current/static/functions-aggregate.html
https://www.postgresql.org/docs/9.6/static/functions-string.html
potamito wrote:so the interpretation for "03, 01)" is that it will return the last 3 characters of a string
potamito wrote:Secondly, how can i not add the "," to the result?
potamito wrote:And lastly, how to add the second last?
ORDER BY tourney_hand_player_statistics.date_played DESC)
Return to Custom Stats, Reports and HUD Profiles
Users browsing this forum: No registered users and 14 guests