Custom Statistics Guide

PokerTracker 3 version 3.10
October 25, 2013
  • Overview

    Customized statistics and reports may be the single most powerful tool in PokerTracker 3. You have the ability to create new stats from all of the information stored in your database, create color code statistical ranges for existing or new stats, or format how the stats are displayed. This is an extremely powerful tool so it may seem complicated at first. Read through the entire documentation; play around with creating new custom statistics and it will seem much less overwhelming.

    You can customize statistics by selecting "Customize" in the PokerTracker 3 menu then choosing "Configure Stats".

     

  • Sections

    The first step in creating a custom statistic is choosing the section that the stat would be located under. Sections are used to group stats logically. For instance, tournament information is sectioned separately from cash game info. Session summary information is sectioned separately from individual hands. The following sections are available to be selected which will dictate the statistics available to you in creating your custom statistic.

    • Holdem Cash Hand – Single Hand Details
    • Holdem Cash Player Statistics – Player Statistics
    • Holdem Cash Session – Single Session Details
    • Holdem Cash Sessions – Summary of Sessions
    • Holdem Tournament Hand – Single Tournament Hand Details
    • Holdem Tournament Player Statistics – Tournament Player Statistics
    • Holdem Tournament Tournament – Single Tournament Details
    • Holdem Tournament Tournaments – Summary of Tournaments

     

     

  • Columns

    Columns are used to map database fields for easy access when calculating stats. They can be as simple as a single field from the database or as complex as multiple fields filtered using any criteria. It is highly recommended that you read the Database Schema - PostgreSQL guide located in the PokerTracker 3 documents section of the website. This guide describes every table and field in the database which will be extremely helpful in understanding the fields and pre-configured columns which are required to create custom statistics.

     

     

    • Existing Columns

      The existing column lists all available columns that are under the section that was selected in the first step along with any new columns that may have been previously customized. Pre configured column info and descriptions are grayed out and are unable to be edited or deleted. You are able to create new columns using available database fields and existing column(s).

    • Edit Column Info

      There are several input fields under the Edit Column Info box which are used to define a column:

      • Name

        This is the name of the expression. It's best to keep with the established naming convention. Begin the name with a prefix indicating what the value represents (cnt_ for a count, flg_ for a boolean, etc). The rest of the name should be lowercase with underscores between words.

      • Expression

        The value of the expression must be valid SQL. This is used to build the SQL statements used to retrieve data. There are some shortcuts available for more complex actions (such as condition statements and date part extraction). Access these shortcuts in the Functions tab of the window after clicking 'Insert'.

      • Insert

        This allows you to easily find and insert database fields, functions or other columns:

        • Database Fields
          Lists the database tables and their associated fields they are located under. Selecting a table will populate the field name window with the field name and the type of value of the field.
        • Columns
          Lists the currently defined columns in the selected section
        • Functions
          Commonly used functions used to calculate statistics.  Appendix A contains a list of all available column functions.
      • Validate

        This allows you to validate that what you have entered in the expression field is valid. The value must be valid or the column cannot be saved.

      • Description

        This is the description of the column.

      • Group By

        In stat sections that are summaries (using mostly sum()'s and count()'s), this must be checked for any column which is not an aggregate. These columns will then be used in the 'GROUP BY' section of the SQL statement.

      • Summary Type

        This determines the values used for the column when summaries are generated for reports.

  • Variables

    Variables are used to perform calculations and access information that cannot be obtained directly via database fields or through SQL SQL in the "Columns" tab. The layout and functionality of the variables tab is very similar to the columns tab.

     

    • Existing Variables

      The list of currently defined variables that are available to create a customized statistic.

    • Edit Variable Info
      • Name

        This is the name of the variable. It's best to keep with the established naming convention. Begin the name with a prefix indicating what the value represents (cnt_ for a count, flg_ for a boolean, etc). The rest of the name should be lowercase with underscores between words.

      • Expression

        This is the value of the expression. There are some shortcuts available for more complex actions (such as looking up identifiers, condition statements, etc.). Access these shortcuts in the Functions tab of the window after clicking 'Insert'.

      • Insert

        This allows you to easily find and insert columns, functions or other variables:

        • Columns
          The list of currently available columns defined under the columns tab.
        • Functions
          Appendix A lists all available functions available for variable expressions.
        • Variables
          The list of currently available variables defined in the variables tab.
      • Validate

        This allows you to validate that what you have entered in the expression field is valid. The value must be valid or the variable cannot be saved.

      • Summary Type

        This determines the values used for the variable when summaries are generated for reports.

  • Statistics

    Now the fun part of creating new statistics using the columns and/or variables defined in the other tabs. You also have the ability to create color coded ranges for existing statistics pre-configured in PokerTracker 3.

    • Definition

      This is where you name, describe, and define the custom statistic. In the "Value Expression" field you need to define the stat using existing columns, variables, or functions.

       

       

    • Format

      The format tab is where you will format how the statistic is displayed in PokerTracker 3.

       

       

      • Title

        The name of the statistic displayed in the header row of reports. (This is a required field and if left blank the statistic will not be available for use within reports)

      • Width

        The default width of the statistical column in the reports.

      • Alignment

        How the statistic is aligned in the reports. Right, center, or left align the stat.

      • Format Expression

        The expression used to define the statistic. Format a column into a monetary statistic, retrieve an identifiers textual value, etc. For example, to format a decimal to display only two numbers to the right of the decimal point you would use /%.2f. The "%" represents the numbers displayed to the left of the decimal point. The ".2" (point two) represents limit the numbers to the right of the decimal point to two. And the "f" represents that the number is a decimal floating point.

        • Insert

          Choose the columns, variables, and/or functions used to define the format expression.

          • Columns
            Available columns used to define the format expression
          • Functions
            Available functions that can be used to define the format expression.
            See Appendix B for a full list of available functions.
          • Variables
            Available variables that can be used to define the format expression
        • Validate

          This allows you to validate what you have entered into the format expression field. The expression must be valid or the statistic cannot be saved.

      • Format Summary Expression

        The expression used to define the summary/footer row of the statistic.

        • Insert

          Choose the columns, variables, and/or functions used to define the format expression.

          • Columns
            Available columns used to define the format summary row expression
          • Functions
            Available functions that can be used to define the format summary row expression.
            See Appendix B for a full list of available functions.
          • Variables
            Available variables that can be used to define the format summary row expression
        • Validate

          This allows you to validate what you have entered into the format summary expression field. The expression must be valid or the statistic cannot be saved.

    • Categories

      The categories tab allows you to choose the category or categories that the statistic will be located under in repots available throughout the PokerTracker application as well as the HUD.

    • Colors

      The colors tab allows you to define a statistics color, color coded ranges, and where the color coding is applied whether it be in the PT3 HUD or in the tracking application (reports). Existing statistics are displayed on the left side and their color or color coded ranges are listed in the top window.

       

       

      • Condition Expression

        The expression used to determine the selected statistics color range. This can be a simple as listing a single statistic and choosing a color or it can be as advanced as having different color coded ranges based on existing columns, variables, functions, or other statistics. The expression must evaluate to a Boolean value using conditional operators.

      • Insert

        Choose the columns, variables, and/or functions used to define the format expression.

        • Columns
          Available columns used to define the color range expression.
        • Functions
          Available functions that can be used to define the color range expression. See Appendix B for a full list of available functions.
        • Variables
          Available variables that can be used to define the color range expression.
        • Statistics
          Available statistics that can be used to define the color range expression.
        • Conditional Operators
          Available conditional operators used to set a color range. Valid operators are:
          • < Greater Than
          • >= Greater Than or Equal To
          • < Less Than
          • <= Less Than or Equal To
          • = Equals
          • != Does not Equal
      • Validate

        This allows you to validate what you have entered into the color range expression field. The expression must be valid or the range cannot be saved.

      • Enable For:

        HUD - Enable the color range expression for the PT3 HUD
        Tracker - Enable the color range expression for the tracking application

      • Color:

        Double click the color to choose the color you would like set for the color range expression.

    • Import Statistics

      If you have found a custom statistic that you would like to download and import from the PokerTracker Statistics Repository or a friend would simply like to share a stat they created with you; click the Import button located on the bottom right hand side under the Statistics tab. Browse to the directory where you saved the PT3 statistics file. Select the file then click Open. After the statistic has successfully been imported it will automatically appears in the existing stats window.

    • Export Statistics

      If you have created a custom statistic that you would like to share with the poker community or a friend; Export the statistic to a file that other users can then import. Select the statistic that you would like to share then click the Export button located at the bottom right hand side of the Statistics tab. Select a directory to save the exported file and click "Save".

      We encourage you to share your custom statistics with the poker community by uploading your exported statistics files to the PokerTracker Repository where other users can then download and import the stats that you have created.

  • Appendix A - Column Functions
    Average
    Expression:
    avg( expr )
    Description:
    The average value of an integer or numeric value
    Convert From UTC
    Expression:
    datefix_fromutc[ expr ]
    Description:
    Convert the date/time from the UTC timestamp to your local timezone
    Count
    Expression:
    count( expr )
    Description:
    Returns the number of selected rows
    Extract Date
    Expression:
    dateextract_date[ expr ]
    Description:
    Extracts the date from a timestamp
    Extract Day
    Expression:
    dateextract_day[ expr ]
    Description:
    Extracts the day of the month from a timestamp
    Extract Month
    Expression:
    dateextract_month[ expr ]
    Description:
    Extracts the month from a timestamp
    Extract Year
    Expression:
    dateextract_year[ expr ]
    Description:
    Extracts the year from a timestamp
    If/Then/Else
    Expression:
    if[ exp, a, b]
    Description:
    If expression then "a" else "b"
    Max
    Expression:
    max( expr )
    Description:
    Selects the maximum value of a column
    Min
    Expression:
    min( expr )
    Description:
    Selects the lowest value of a column
    Sum
    Expression:
    sum( expr )
    Description:
    Returns the total sum of a column

     

  • Appendix B - Statistic & Variable Functions
    Build Date
    Expression:
    build_date( year, month, day, hour, minute, second)
    Description:
    Builds a date variable.
    Return value:
    Date
    Date Diff
    Expression:
    date_diff( date1, date2, units)
    Description:
    Determines how long date 1 follows after date 2. Valid units: 'minutes', 'hours', 'days'
    Return value:
    Integer
    Format
    Expression:
    format( format_str, …. )
    Description:
    Formats a string, inserting any number of values into the string. Use {1}, {2}, {3}, … to indicate where the value should be inserted.
    Return value:
    String
    Format Bool
    Expression:
    format_bool( value, format )
    Description:
    Formats a boolean. Valid formats: 'check', 'yesno', 'yn'
    Return value:
    Boolean
    Format Date
    Expression:
    format_date( date, format )
    Description:
    Formats a date. Valid formats: 'date', 'datetime', 'datetimes', 'datetimesm'
    Return value:
    String
    Format Money
    Expression:
    Format Money
    Description:
    Formats a number into a money format.
    Return value:
    String
    Format Number
    Expression:
    format_number( value, decimals, commas, color )
    Description:
    Formats a number with decimals, commas, and color.
    Return value:
    String
    If
    Expression:
    if( expr, then, else )
    Description:
    Checks the Boolean value of an expression.
    Return value:
    Then or Else depending on whether the expression is true or false
    Lookup From Id
    Expression:
    lookup_from_id( id, lookup )
    Description:

    Finds the value lookup for the given id. Valid lookups: 'blindsbb', 'blindsdesc',
    'sitename', 'siteabbr', 'cardpair', 'card', 'card_rank', 'finalhand', 'month',  
    'tourneytabletype', 'tourneytype'

    Return value:
    Variable Types
    Lookup Handrank
    Expression:
    lookup_handrank( id_final_hand, showed, folded )
    Description:
    Finds the name of the final hand, or if the player folded.
    Return value:
    String
    Lookup Limit BB
    Expression:
    lookup_limit_bb( id_limit )
    Description:
    Finds the value of the BB for the limit.
    Return value:
    Number
    Lookup Limit Desc
    Expression:
    lookup_limit_desc( id_limit, info )
    Description:
    Finds the description of the id_limit.
    Return value:
    String
    Lookup Limit Info
    Expression:
    lookup_limit_info( id_limit, info )
    Description:
    Finds information about the limit. Valid info values: 'bb', 'sb', 'desc', 'nl', 'pl', 'sortval'
    Return value:
    Variable Type
    Lookup_Realminutes_Day
    Expression:
    lookup_realminutes_day( id_player, day, month, year )
    Description:
    Finds the actual minutes played for the given player in the given day/month/year.
    Return value:
    Number
    Lookup Realminutes Limit
    Expression:
    lookup_realminutes_limit( id_player, id_limit )
    Description:
    Finds the actual minutes played for the given player at the given limit.
    Return value:
    Variable Type
    Lookup Realminutes Day
    Expression:
    lookup_realminutes_day( id_player, day, month, year )
    Description:
    Finds the actual minutes played for the given player in the given day/month/year.
    Return value:
    Number
    Lookup Realminutes Month
    Expression:
    lookup_realminutes_month( id_player, month, year )
    Description:
    Finds the actual minutes played for the given player in the given month/year.
    Return value:
    Number
    Lookup Realminutes Player
    Expression:
    lookup_realminutes_player( id_player )
    Description:
    lookup_realminutes_player( id_player )
    Return value:
    Number
    Max
    Expression:
    max( a, b )
    Description:
    Finds the maximum of the two values a or b.
    Return value:
    Maximum Value
    Min
    Expression:
    min( a, b )
    Description:
    Finds the minimum of the two values a or b.
    Return value:
    Minimum Value