how to check if a player has a note?

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

how to check if a player has a note?

Postby merkur33 » Sat Apr 25, 2009 7:21 am

I want to make a report of all players in my observed tourney hands database with more than x hands that don't have a player note. Since all the notes seem to be stored in the same field with some different lookup values/identyfiers/whatever, this seems to be a little bit complicated (if at all possible...) can somebody tell me how to do this? Im looking specifically only for player notes, not hand notes.
merkur33
 
Posts: 126
Joined: Tue Nov 25, 2008 11:57 am

Re: how to check if a player has a note?

Postby kraada » Sat Apr 25, 2009 9:26 am

Create a custom report with the columns: Notes, Player and Hands, click Filters, uncheck "Filter on Active Player" and in the filter expression add flg_note and save the filter.

Run the report and it should show you all players with and without notes. Now to see the data in the order you want it, click the column above the note to sort by players with notes until you see no notes first, then hold ctrl and click the column for hands and sort it so that the players with more hands are at the top.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: how to check if a player has a note?

Postby merkur33 » Sun Apr 26, 2009 10:53 am

Sorry, but i can't find a "Notes"-Stat in the Holdem Tournament Player Statistics section, and when trying to filter for flg_note, it tells me it wasnt valid, thats probably because there is no such column. Im talking about a player stats report. Maybe i'm mixing up something stupid, but i couldn't find theses stats/columns, thats why i posted here.

Edited:
hold ctrl and click the column for hands and sort it so that the players with more hands are at the top
whats that? Never heard of this functionality. Can add a second sort key by ctrl-clicking a second column?
merkur33
 
Posts: 126
Joined: Tue Nov 25, 2008 11:57 am

Re: how to check if a player has a note?

Postby WhiteRider » Sun Apr 26, 2009 5:32 pm

You can create a new Column in the Holdem Cash Player Statistics section and call it "flg_note" with an expression of:
player_real.flg_note

When you have this you can add the filter expression kraada suggests.
flg_note
..will show players with notes;
NOT flg_note
..will show players without notes.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: how to check if a player has a note?

Postby merkur33 » Mon Apr 27, 2009 3:49 pm

Thanks, thats what i wanted to know. I did as you said; for some reason i couldn't combine "NOT flg_note" and "cnt_hands > 1999" to one filter expression, while both parts alone where valid. So i just filtererd for not flg_note, an i got an error message:

Code: Select all
2009/04/27 21:41:09.828: [00003864][PostgresConnection (Error)] Unable to execute query: SELECT (player.player_name) as "str_player_name", (count(tourney_holdem_hand_player_statistics.id_hand)) as "cnt_hands", (sum( (CASE WHEN ( (tourney_holdem_blinds.amt_bb *tourney_holdem_blinds.val_nlpl_mult)) <> 0 THEN ((tourney_holdem_hand_player_statistics.amt_won * 1.0 )/( (tourney_holdem_blinds.amt_bb *tourney_holdem_blinds.val_nlpl_mult))) ELSE 0 END) )) as "amt_bb_won", (sum( (case when(tourney_holdem_hand_player_statistics.flg_blind_b = false AND tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_p_face_raise AND tourney_holdem_hand_player_statistics.flg_p_fold) then  1 else  0 end) )) as "cnt_p_fold_sb_to_pfr", (sum( (case when(tourney_holdem_hand_player_statistics.flg_blind_b = false AND tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_p_face_raise) then  1 else  0 end) ) ) as "cnt_p_sb_face_raise", (sum((case when(tourney_holdem_hand_player_statistics.flg_vpip) then  1 else  0 end))) as "cnt_vpip", (sum((case when(tourney_holdem_hand_player_statistics.flg_p_fold AND tourney_holdem_hand_player_statistics.flg_p_face_raise) then  1 else  0 end))) as "cnt_p_fold_to_raise", (sum((case when(tourney_holdem_hand_player_statistics.flg_p_face_raise) then  1 else  0 end))) as "cnt_p_face_raise", (sum((case when(tourney_holdem_hand_player_statistics.cnt_p_raise > 0) then  1 else  0 end))) as "cnt_pfr", (sum( (case when(tourney_holdem_hand_player_statistics.flg_p_first_raise AND tourney_holdem_hand_player_statistics.flg_p_open_opp) then  1 else  0 end)) ) as "cnt_p_raise_first_in", (sum((case when(tourney_holdem_hand_player_statistics.flg_p_open_opp) then  1 else  0 end))) as "cnt_p_open_opp", (sum((case when(tourney_holdem_hand_player_statistics.flg_p_ccall) then  1 else  0 end))) as "cnt_p_ccall", (sum( (case when( NOT(NOT(tourney_holdem_hand_player_statistics.flg_p_face_raise) OR (tourney_holdem_hand_player_statistics.flg_p_limp) OR (tourney_holdem_hand_player_statistics.flg_p_first_raise)) AND (tourney_holdem_hand_player_detail.amt_blind=0)) then  1  else  0  end) )) as "cnt_p_ccall_opp", (sum((case when(tourney_holdem_hand_player_statistics.flg_f_saw) then  1 else  0 end))) as "cnt_f_saw", (sum((case when(tourney_holdem_hand_player_detail.amt_f_bet_facing > 0 AND tourney_holdem_hand_player_statistics.flg_f_fold) then  1 else  0 end))) as "cnt_f_bet_def_action_fold", (sum((case when(tourney_holdem_hand_player_detail.amt_f_bet_facing > 0) then  1 else  0 end))) as "cnt_f_bet_def_opp", (sum((case when(tourney_holdem_hand_player_statistics.flg_f_bet) then  1 else  0 end))) as "cnt_f_bet", (sum(tourney_holdem_hand_player_statistics.cnt_f_raise)) as "cnt_f_raise", (sum((case when(tourney_holdem_hand_player_statistics.flg_t_bet) then  1 else  0 end))) as "cnt_t_bet", (sum(tourney_holdem_hand_player_statistics.cnt_t_raise)) as "cnt_t_raise", (sum((case when(tourney_holdem_hand_player_statistics.flg_r_bet) then  1 else  0 end))) as "cnt_r_bet", (sum(tourney_holdem_hand_player_statistics.cnt_r_raise)) as "cnt_r_raise", (sum(tourney_holdem_hand_player_statistics.cnt_f_call)) as "cnt_f_call", (sum(tourney_holdem_hand_player_statistics.cnt_t_call)) as "cnt_t_call", (sum(tourney_holdem_hand_player_statistics.cnt_r_call)) as "cnt_r_call", (sum((case when(tourney_holdem_hand_player_statistics.flg_showdown) then  1 else  0 end))) as "cnt_wtsd", (player_real.flg_note) as "flg_note" FROM   tourney_holdem_hand_player_statistics , tourney_holdem_hand_player_detail, tourney_holdem_blinds, player player_real, player WHERE  (tourney_holdem_hand_player_statistics.id_hand = tourney_holdem_hand_player_detail.id_hand  AND tourney_holdem_hand_player_statistics.id_player = tourney_holdem_hand_player_detail.id_player)   AND (tourney_holdem_blinds.id_blinds = tourney_holdem_hand_player_statistics.id_blinds)  AND (player_real.id_player = tourney_holdem_hand_player_statistics.id_player_real)  AND (player.id_player = tourney_holdem_hand_player_statistics.id_player)  GROUP BY (player.player_name) HAVING (NOT (player_real.flg_note)); Reason: Fatal Error (ERROR:  column "player_real.flg_note" must appear in the GROUP BY clause or be used in an aggregate function )


Any clue what went wrong?
merkur33
 
Posts: 126
Joined: Tue Nov 25, 2008 11:57 am

Re: how to check if a player has a note?

Postby kraada » Mon Apr 27, 2009 5:05 pm

You need to check the "group by" box in your column.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: how to check if a player has a note?

Postby WhiteRider » Mon Apr 27, 2009 5:58 pm

kraada wrote:You need to check the "group by" box in your column.

:oops:
Sorry - I forgot we worked that out the other day..
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: how to check if a player has a note?

Postby Tract0rDan » Fri May 22, 2009 2:02 am

Great report thanks guys (I was pointed here from another post). Is there any way of getting the actual note to show up in the report, or do I have to go into each player individually and look?
Tract0rDan
 
Posts: 37
Joined: Tue Sep 09, 2008 9:02 am

Re: how to check if a player has a note?

Postby kraada » Fri May 22, 2009 9:13 am

If you add another column calling the notes.notes database value it may display the text for you; I haven't tested this (and I'll play around with it in a bit to see if it works for me), but that would be the only way to do it at this point.
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