question about "general" 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

Re: question about "general" stats

Postby Messenjupp » Wed Jul 27, 2011 9:34 am

Also when I make a report for specific dates..how do I filter for dates?

Lets say I wanna filter all hands that I have notes on that are played from the 15th on.

filter expression for filtering notes is flg_no but

flg_note and #date# > 2011/07/14

does not work so I tried it with clicking on simple filters and it seems to work. The filter expression is still only flg_note but the report default filter in the upper right corner shows played since: 2011/07/15 so I guess this is the way to do that, right?
Messenjupp
 
Posts: 204
Joined: Wed Oct 08, 2008 6:54 am

Re: question about "general" stats

Postby kraada » Wed Jul 27, 2011 9:56 am

Or click Simple Filters in the blue Filters section - that lets you select dates and other filters as if they were in the general Filters window.

You can't export hands from a custom report yet, but that will be possible in PT4.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: question about "general" stats

Postby Messenjupp » Wed Jul 27, 2011 10:26 am

Lets say I make a HH review like I do right now and hand comes up where I want some more informations about a villain and I have some reports like what hands he 3bet with that also went to showdown and stuff like that. I have a total of 10k on him but only played 600 against him directly. I also have two seperate DBs. One for played hands and one for observed hand. In order to run this report effectively I have to switch to the othre DB, right? There is now way any report will show me hands for both DBs, right? If so...is this a problem in general cause its simply not possible with two seperate DBs or is this more of a problem thats its not possible right now but will be possible with PT4?
Messenjupp
 
Posts: 204
Joined: Wed Oct 08, 2008 6:54 am

Re: question about "general" stats

Postby Messenjupp » Wed Jul 27, 2011 10:28 am

kraada wrote:Or click Simple Filters in the blue Filters section - that lets you select dates and other filters as if they were in the general Filters window.


Mistake on my part...I used the simple filter....just wasnt sure if this isnt something that can be done with an expression too. But I guess filter is easier especially for an amateur like me, lol.
Messenjupp
 
Posts: 204
Joined: Wed Oct 08, 2008 6:54 am

Re: question about "general" stats

Postby kraada » Wed Jul 27, 2011 11:03 am

Reports cannot run across databases - this is a PostgreSQL limitation.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: question about "general" stats

Postby WhiteRider » Wed Jul 27, 2011 12:20 pm

Messenjupp wrote:1. I want a zero added to every single digit month....so 26.07.2011...is this easily possible or not...if its kind of a hassle I pass on that. Maybe something like month needs to be two digits?

To do this you need to add another data field for the possible zero (ie. another {4} ), which will be blank if the number is >= 10 and '0' if it isn't.
I won't rewrite the full expression, but it's like this : (pseudocode since I'm in a hurry)

format( '{1}{2}', if(day<10, '0', ''), day )

Here {1} will be replaced by the content of the IF statement, and that is a string containing a zero if day is less than 10, otherwise it's an empty string.
You can do the same for the month field.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: question about "general" stats

Postby Messenjupp » Wed Jul 27, 2011 4:38 pm

kraada wrote:For the k notation stat, change the format expression to:

if( cnt_hands > 9999, format('{1}k', format_number((cnt_hands / 1000), 0, false, false)), if( cnt_hands>999 , format( '{1}k' , format_number((cnt_hands / 1000) , 1 , false , false)) , cnt_hands )


I just tried that and it says value expression is not valid

This is the old one that works
if( cnt_hands > 999, format( '{1}k', format_number((cnt_hands / 1000), 1, false, false)), cnt_hands )

and I tried this one
if( cnt_hands > 9999, format('{1}k', format_number((cnt_hands / 1000), 0, false, false)), if( cnt_hands > 999, format( '{1}k', format_number((cnt_hands / 1000), 1, false, false)), cnt_hands )

and it does not
Messenjupp
 
Posts: 204
Joined: Wed Oct 08, 2008 6:54 am

Re: question about "general" stats

Postby kraada » Wed Jul 27, 2011 5:32 pm

Small error in parenthesis matching. Try this instead:

if( cnt_hands > 9999, format('{1}k', format_number((cnt_hands / 1000), 0, false, false), if( cnt_hands > 999, format( '{1}k', format_number((cnt_hands / 1000), 1, false, false)), cnt_hands )))
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: question about "general" stats

Postby Messenjupp » Wed Jul 27, 2011 6:36 pm

1.
kraada wrote:Small error in parenthesis matching. Try this instead:

if( cnt_hands > 9999, format('{1}k', format_number((cnt_hands / 1000), 0, false, false), if( cnt_hands > 999, format( '{1}k', format_number((cnt_hands / 1000), 1, false, false)), cnt_hands )))


Not gonna work too....although it says that the expression is valid but once I want to use it in my HUD there comes an error message on the hand...something like....."expression: invalid number of argument passed for function if...expecting 3 and receiving 2"

2. I give up on adding 0 to the date. I get what I have to do and I tried several stuff the last 2 hours but the best I could come up with is

format('{1}{2}.{3}{4}.{5}', if( date_played_day < 10, '0', format_number(date_played_day, 0, false, false)), if( date_played_month < 10, '0', format_number(date_played_month, 0, false, false)), format_number(date_played_year, 0, false, false))

but this gives me 260.2011{4}.{5} instead of 26.07.2011

When I use this one just for the day

format('{1}{2}', if( date_played_day < 10, '0', format_number(date_played_day, 0, false, false)))

it gives me either the correct number if the number is at least 10 or it gives me 0.

Somehow I'm missing on how to assign two different numbers to {1} and {2}. It only uses {1} and thats it.

3. But in order to prove to you that I really tried ;-) I might have found a little error in the tutorial. http://www.pokertracker.com/forums/view ... 45&t=22599

Example 2 (Holdem Cash Player Statistics section)
format( '{1} had {2} steal opportunities and raised {3} times', str_player_name, format_number(cnt_steal_opp,0,false,false), format_number(cnt_steal_att,0,false,false) )
..would display as:
Player1 had 20 steal opportunities and raised 12 times

More realistically, you might use this format expression:
format( '{1}% ({2}/{3})', (cnt_steal_att / cnt_steal_opp) * 100, format_number(cnt_steal_opp,0,false,false), format_number(cnt_steal_att,0,false,false) )
..which would display as:
60% (12/20)


The bolded parts have to be the other way, right? If the display should be 12/20 steal_opp has to be the 2nd format number and steal_att has to come first.
Messenjupp
 
Posts: 204
Joined: Wed Oct 08, 2008 6:54 am

Re: question about "general" stats

Postby kraada » Wed Jul 27, 2011 6:53 pm

Messenjupp wrote:1.
kraada wrote:Small error in parenthesis matching. Try this instead:

if( cnt_hands > 9999, format('{1}k', format_number((cnt_hands / 1000), 0, false, false), if( cnt_hands > 999, format( '{1}k', format_number((cnt_hands / 1000), 1, false, false)), cnt_hands )))


Not gonna work too....although it says that the expression is valid but once I want to use it in my HUD there comes an error message on the hand...something like....."expression: invalid number of argument passed for function if...expecting 3 and receiving 2"


That really ought to not validate then. I see what's going on though, try this instead:

if( cnt_hands > 9999, format('{1}k', format_number((cnt_hands / 1000), 0, false, false)), if( cnt_hands > 999, format( '{1}k', format_number((cnt_hands / 1000), 1, false, false)), cnt_hands ))
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

PreviousNext

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

Who is online

Users browsing this forum: No registered users and 0 guests