Page 1 of 2

Villain range based on showdowns

PostPosted: Sat Nov 15, 2014 6:31 pm
by xHKLx
Im trying to build stat that shows range for given action based on showdowns.
I have it as matrix of stats where forthe action I have included as well id hole card. I'm looking for the way to do this without making huge number of stats coz there is only <1600 columns in cache table.

I have a column as a string where I have cards for action. It looks like this string_agg(case when(...action.... then lookup_hole_cards.hole_cards ::int::text else null end,'').

My question is: is there a way to make it cachable, so I could make 169 stats that update fast base on this column?

what function to use in stat to get info from this string that given hole card is there e.g. x times?

Another question: how to get info what was last showdown, previous and so on? I think I can use substr(column_name,1,3), after replacing poket pars in a way KK -> KKp, so that every hole card has 3 digits.

But I'm doing something wrong coz it does not work, it hud profile it shows XYZ.
Sorry, for noob question but I just started making some not very basic stats.

Re: Villain range based on showdowns

PostPosted: Sun Nov 16, 2014 9:38 am
by kraada
XYZ is shown in the Hud Editor as a placeholder for all stats which output text; the preview window isn't that intelligent and it doesn't test with actual output. Putting it in your HUD and then looking in the replayer is probably your best way to test. I'm not sure what advice to give you about how to build this, though.

Re: Villain range based on showdowns

PostPosted: Sun Nov 16, 2014 10:09 am
by xHKLx
Hi,
on hud I'm getting dash, but I know there should be some output. While saving stat there is no error.

Thanks anyway

Re: Villain range based on showdowns

PostPosted: Sun Nov 16, 2014 10:22 am
by kraada
Is this column cached? If so try unticking Cache and see if that helps.

Re: Villain range based on showdowns

PostPosted: Sun Nov 16, 2014 10:36 am
by xHKLx
It's not cashed. I cannot do this, getting info that this column cannot be cashed.
I've just used this stat on some player report and got error: invalid input syntax for integer: "A4o"

Re: Villain range based on showdowns

PostPosted: Sun Nov 16, 2014 11:47 am
by kraada
Well, that isn't an integer that is true. What are you using as the format type?

Re: Villain range based on showdowns

PostPosted: Sun Nov 16, 2014 12:41 pm
by xHKLx
I have put ignore_formating() as a format.

Re: Villain range based on showdowns

PostPosted: Mon Nov 17, 2014 4:41 am
by WhiteRider
Try setting the format type to None and see if you get any data with just the plain column value. If not, you'll need to show us exactly what you're doing in the column so that we can see what is going on.

Re: Villain range based on showdowns

PostPosted: Mon Nov 17, 2014 11:59 am
by xHKLx
Hi

format None does not work.

So, what I want to achieve is to get string made out of showdowns for an action for later manipulation in stat.

E.g for action preflop raise from sb, I have:

(string_agg
(case when
( tourney_hand_player_statistics.cnt_p_raise > 0 AND NOT (tourney_hand_player_statistics.flg_p_limp) AND tourney_hand_player_statistics.position=9


then (lookup_hole_cards.hole_cards)::int::text else null end, ''
)
)



Base on this column I want to check if hole cards exist within this string, I guess I can do this with strpos(column, 'AKo').

Re: Villain range based on showdowns

PostPosted: Tue Nov 18, 2014 7:42 am
by sawwee
This is what you want:

Code: Select all
(string_agg((case when tourney_hand_player_statistics.cnt_p_raise > 0 AND NOT tourney_hand_player_statistics.flg_p_limp AND tourney_hand_player_statistics.position=9 then lookup_hole_cards.hole_cards else NULL end), ', '))


If you use this column you don't need any formatting.

As a return: do you have any idea how to count the occourance of some substrings in the result of this stat without creating new coulmns? Is there any function available which you can use for it? If not, is there any other trick to count - for example - "AKs" in the result of this stat? With strpos you can check if a give holecard is in the string but can't check how many times is it there. Any idea?