Page 1 of 4

Tournament Bust out hands or last hand tournament

PostPosted: Sat Nov 30, 2013 3:19 pm
by Dutchraise72
I have a report for bust out hands with this query

Code: Select all
(tourney_hand_player_statistics.amt_before = tourney_hand_player_statistics.amt_bet_ttl AND tourney_hand_player_statistics.flg_won_hand = false)


But this one isn't right

I want to lookup my bust out hands at the end of the day. For example i played 22 tournament but with this query i see 51 bust out hand. This is probably because i played a lot of rebuy 3x turbo and this query shows also the lost hand in a rebuy tournament when it is not hte last hand i played in that tournament because of the rebuy i made.

What i want is a query that shows only the last hand in a tournament even when it's a rebuy tournament i only want to see the final last hand..

Can any help me?

Re: Tournament Bust out hands or last hand tournament

PostPosted: Sun Dec 01, 2013 5:48 am
by WhiteRider
Unfortunately that isn't simple - I don't know of a way to do that, although one of the SQL gurus here may be able to come up with a query for you.

Re: Tournament Bust out hands or last hand tournament

PostPosted: Sun Dec 01, 2013 11:55 am
by Dutchraise72
it has to be something like

*select all tournament id's and select from that single row tournament id the highest hand id.

Anyone?

Re: Tournament Bust out hands or last hand tournament

PostPosted: Tue Dec 03, 2013 10:43 am
by Dutchraise72
Is there a way i can see from what tables the reports are created. I am Afraid that the tables i need for this query are not in the reports.

Re: Tournament Bust out hands or last hand tournament

PostPosted: Tue Dec 03, 2013 12:17 pm
by kraada
You can see every query run in our log files, just start PT4 with the Logging Enabled link and you can find the log via File -> Show User Data Folder and it's the text file called PokerTracker4 that is in the folder that shows up.

Re: Tournament Bust out hands or last hand tournament

PostPosted: Thu Dec 05, 2013 1:28 am
by Dutchraise72
I created a new hand report with all hands i played today. I created a new custom stat Tournament ID from the (table tourney_hand_player_statistics.id_tourney) as "id_tourney"

Now i have all the tourney id's (not unique) and i have all the hand id (unique).

What i need is a expression to select the highest hand number from field (tourney_hand_summary.hand_no) from every tourney. I use (table tourney_hand_player_statistics.id_tourney) as tourney id.

Re: Tournament Bust out hands or last hand tournament

PostPosted: Thu Dec 05, 2013 6:19 am
by PJs Ronin
@Dutch

Anywhere/way you can get an SQL "MAX" function in there to limit hand_id?

Re: Tournament Bust out hands or last hand tournament

PostPosted: Thu Dec 05, 2013 7:51 am
by Dutchraise72
You are right. i know i need a MAX function because i have this in microsoft access but in a pokertracker report is not that simple :)

This is what i tried. I duplicated the column hand_no stat as Highest_hand_ID and changed the summery type in the expression to Max. I also created a new duplicated from the stat Hand # as Max hand and use Higest_Hand_ID as value expression. Then I tried to use this custom stat Maxhand in my report but this only shows all the hands i played that day and the highest hand number is shown as a summary in the bottom.

So i know i am on the right path but still not there. There must be a simple re way to do this i hope.

Re: Tournament Bust out hands or last hand tournament

PostPosted: Fri Dec 06, 2013 2:49 am
by PJs Ronin
In review I am not sure the MAX statement will be of much use as within PT4 it is defined as:

max(a,b) and only compares two values.

Another avenue you might like to explore is this one:

Screenshot2013-12-06.png

which you will need to link back to the tourney from which it came, but you should end up with a one on one result.

Re: Tournament Bust out hands or last hand tournament

PostPosted: Fri Dec 06, 2013 4:33 pm
by Dutchraise72
Hi Ronin,

tnx for thinking with me to find a solotion but the stat Id_final_hand is not the last hand in a tournament but the hand at the river and that id is not unique. I stead i use the stat Hand # this gives me the tournament hand no from the pokersite

See attachment
Naamloos.png


As you can see i have the Site tournament ID and the finalhand ID as you suggested. In this report i use (tourney_hand_player_statistics.amt_before = tourney_hand_player_statistics.amt_bet_ttl AND tourney_hand_player_statistics.flg_won_hand = false) as expression but if i leave it out then i will get all hand i played that day.

When i try to ad a stat where i aded in the stat a Max value then i get an SQL error.

Code: Select all
Reason: Fatal Error (ERROR:  column "tourney_hand_summary.id_hand" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT (tourney_hand_summary.id_hand) as "id_hand", (tourney...                 ^ )


It would be nice if Pokertracker stores the pokersite hand id of the last hand played in a tournament with the tournament id in a table so we can extract it from here. :D