easy stats

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

easy stats

Postby raph156 » Fri Aug 19, 2011 6:21 am

Hi,
i want thise
sum( if[ (holdem_hand_player_statistics.id_holecard = 89), (75,36) , 0])
Thanks for your help
raph156
 
Posts: 159
Joined: Tue Feb 09, 2010 3:22 pm

Re: easy stats

Postby kraada » Fri Aug 19, 2011 8:30 am

I'm not certain exactly what you are asking for - could you elaborate a little?
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: easy stats

Postby raph156 » Fri Aug 19, 2011 8:59 am

that work
sum( if[ (holdem_hand_player_statistics.id_holecard = 89), 75, 0])
but that not
sum( if[ (holdem_hand_player_statistics.id_holecard = 89), 75,36, 0])
raph156
 
Posts: 159
Joined: Tue Feb 09, 2010 3:22 pm

Re: easy stats

Postby kraada » Fri Aug 19, 2011 9:15 am

Right, the first one says if the players's holecard is 89, add 75, if not do nothing. So you'll get the number of times the player had holecard 89, times 75.

If you want the times when the player had either id_holecard = 89 or id_holecard = 75, you want to do instead:


sum( if[ (holdem_hand_player_statistics.id_holecard = 89) OR (holdem_hand_player_statistics.id_holecard = 75), 1, 0])

That will sum up the number of times the player had either of these two hands. You can add more kinds of holecards with more OR statements.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: easy stats

Postby raph156 » Fri Aug 19, 2011 9:34 am

i want
if the players's holecard is 89, add 75,23
raph156
 
Posts: 159
Joined: Tue Feb 09, 2010 3:22 pm

Re: easy stats

Postby kraada » Fri Aug 19, 2011 10:48 am

Ah, the issue is one of localization - you want to add 75.23 - the comma in the if statement indicates the end of the current section and can't be used in that way - instead you want to use period.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


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

Who is online

Users browsing this forum: No registered users and 0 guests