Page 1 of 1

Min() use in columns

PostPosted: Mon Jan 10, 2011 7:41 pm
by ChicagoAl
So I want to create a Column expression which counts a number of actions, but with a maximum value. For example, if I wanted to create a column that simply counted the number of times a player limped preflop, I would use the following:

sum(if[tourney_holdem_hand_player_statistics.flg_p_limp, 1, 0])

I haven't been able to figure out how to store the lesser of the number of limps or, say, the value 999 - so that the number stored in the column would never reach or exceed 1000. I was hoping that the min() function would help me here, but the following statement returns invalid by the PT3 Configure Statistics UI:

min(sum(if[tourney_holdem_hand_player_statistics.flg_p_limp, 1, 0]),999)

Is there a way to accomplish this?

Thanks - and sorry for bugging you guys so much!

Al

Re: Min() use in columns

PostPosted: Mon Jan 10, 2011 7:47 pm
by kraada
I don't believe that is going to work, but you can display a maximum if you want in the format expression of a custom stat if you'd like. For example you could use:
if(cnt_p_limp < 999, format_number( (cnt_p_limp / cnt_hands) * 100, 0, false, false), 'Limps a lot!')

That would display the player's limp percentage if they'd limped less than 999 times, or "Limps a lot!" if they limped more than that.

Re: Min() use in columns

PostPosted: Mon Jan 10, 2011 7:51 pm
by ChicagoAl
Thanks Kraada - I did figure out how to do it at display time. What I'm trying to accomplish really requires that I store it with the max value in the column though. No way you can think of to cap the value stored?

Re: Min() use in columns

PostPosted: Tue Jan 11, 2011 4:19 am
by WhiteRider
I don't think he can do that either. I've thought about this sort of thing in the past and not come up with a solution.