Stats sens

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

Stats sens

Postby raph156 » Mon Aug 29, 2011 6:32 am

Hi
sum( if[ (holdem_hand_player_statistics.id_holecard = 112) AND (holdem_hand_player_statistics.flg_won_hand), 100-47.59, if[ (holdem_hand_player_statistics.id_holecard = 112) AND NOT( holdem_hand_player_statistics.flg_won_hand),-47.59,0]])
OR
sum( if[ (holdem_hand_player_statistics.id_holecard = 112) AND (holdem_hand_player_statistics.flg_won_hand), 100-47.59, if[ (holdem_hand_player_statistics.id_holecard = 112) AND (NOT holdem_hand_player_statistics.flg_won_hand),-47.59,0]])
The twice are valide but there is a difference sens?
I want: if 112 and won hand, 100-47.49, if 112 and lose hand, -47.49, 0
Tx for help
raph156
 
Posts: 159
Joined: Tue Feb 09, 2010 3:22 pm

Re: Stats sens

Postby kraada » Mon Aug 29, 2011 8:56 am

Hands are always either won or lost - you could simply do:

sum( if[ (holdem_hand_player_statistics.id_holecard = 112) AND (holdem_hand_player_statistics.flg_won_hand), 100-47.59,-47.59])

And that would work as well. Also you could simplify 100-47.59 to 52.41 - but the two things you pasted are identical as far as I can tell.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Stats sens

Postby raph156 » Mon Aug 29, 2011 9:37 am

Ok thats the same, but in your expression "sum( if[ (holdem_hand_player_statistics.id_holecard = 112) AND (holdem_hand_player_statistics.flg_won_hand), 100-47.59,-47.59])" when 112 and lose = -47.59, thats ok, but when other id and lose or win the expression ll count -47.59 too? or its work just for the first situation when id=112?
raph156
 
Posts: 159
Joined: Tue Feb 09, 2010 3:22 pm

Re: Stats sens

Postby kraada » Mon Aug 29, 2011 10:21 am

Oh, I see your problem - then yes you will need to nest if[] statements.

This should work:

sum( if[ (holdem_hand_player_statistics.id_holecard = 112) AND (holdem_hand_player_statistics.flg_won_hand), 52.41, if[ (holdem_hand_player_statistics.id_holecard = 112),-47.59,0]])

I've tested and that validates for me.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Stats sens

Postby raph156 » Mon Aug 29, 2011 11:37 am

with thise one -47,59 ll happen every time id=112 and i want it when id=112 and lose hand
tx for help
raph156
 
Posts: 159
Joined: Tue Feb 09, 2010 3:22 pm

Re: Stats sens

Postby kraada » Mon Aug 29, 2011 11:41 am

You must either win the hand or lose it.

If you win it, the first if triggers. If you don't, the second one does.
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