Page 1 of 1

vpip for each distinct position and number of players

PostPosted: Fri Jul 04, 2008 1:33 am
by will123195
how can i query my vpip for each distinct position and number of players?

Re: vpip for each distinct position and number of players

PostPosted: Fri Jul 04, 2008 4:26 am
by WhiteRider
The simplest way would be to use filters to isolate each combination of position and number of players, but this is obviously quite long winded and won't show all the results on the same screen.
If you want to see them all together, you'll need to create a Custom Stat for each combination - once you create the first one you can duplicated and edit it to create the rest. Then you can create Custom Report to show your new stats.
Documentation.

Re: vpip for each distinct position and number of players

PostPosted: Sun Jul 06, 2008 2:59 am
by will123195
i figured out the sql for this:

Code: Select all
SELECT numerator.position,
       count(*)::float /
   (SELECT count(*)
    FROM tourney_holdem_hand_player_statistics denominator
    WHERE denominator.id_player = 4
    and numerator.position = denominator.position
    GROUP BY denominator."position")::float
   as vpip
FROM tourney_holdem_hand_player_statistics numerator
WHERE numerator.id_player = 4
and flg_vpip is true
GROUP BY numerator."position"
order by position

Re: vpip for each distinct position and number of players

PostPosted: Sun Jul 06, 2008 3:28 am
by will123195
i think this is close to what i was looking for:

Code: Select all
SELECT numerator.position, summary.cnt_players_f,
       count(*)::float /

   (SELECT count(*)
    FROM tourney_holdem_hand_player_statistics denominator
    WHERE denominator.id_player = 4
    and numerator.position = denominator.position
    GROUP BY denominator."position")::float
   as vpip
   
FROM tourney_holdem_hand_player_statistics numerator
left join tourney_holdem_hand_summary summary on summary.id_hand = numerator.id_hand
WHERE numerator.id_player = 4
and flg_vpip is true
GROUP BY numerator."position", summary.cnt_players_f
order by position, cnt_players_f