Once you have selected the Holdem Cash Player Statistics section click on the Columns tab then click the New button to create a new empty Column.
Enter the name of your column in the Name field - I'm creating cnt_p_limp_fold first.
Now we need to enter the Expression, which is where the work is done.
If you have been given a column expression in the forums then you can just copy and paste the text of it here, and skip to the end of this section to enter the Description. You'll want to click Validate to make sure the expression is correct, though - if it isn't you might need to recreate it by following the steps below.
You can just type your expression into the Expression field if you know exactly what you want, but the best way to make sure you construct it correctly is to use the blue Insert link, and that is what I'll use here.
Once you get used to building expressions and know the common elements you'll probably use a combination of Insert and typing.
For more information on the building blocks of expressions, see Constructing Column Expressions.
Since our column needs to count up the number of times the player did something, we need to start with the SUM function.
Click Insert and select the Functions tab.
Scroll down to find the Sum function. Select it and click OK.
This will take you back to the main Column tab and your expression will now look like this:
Now we need to replace 'expr' with the next part of the expression, which is an IF statement to determine whether or not the condition we're looking for is true.
Highlight the 'expr' part of the expression (as shown above) and click Insert again, so that whatever we insert will replace 'expr'.
On the Insert window select the Functions tab again, but this time select If/Then/Else and click OK.
You should now see this in the Expression field:
sum( if[ expr , a , b ] )
Now we need to enter the expression part of the IF statement, to check that the player limped and then folded.
We insert the two conditions separately.
First we'll insert the database field which indicates whether or not the player limped, which is holdem_hand _player_statistics.flg_p_limp.
Highlight 'expr' again, and click Insert.
On the Database Fields tab find and select holdem_hand _player_statistics in the Table Name list on the left, then on the right find and select flg_p_limp in the Field Name list, and click OK. (You can click the column header to sort the list alphabetically.)
Your expression should now look like this:
sum( if[ holdem_hand _player_statistics.flg_p_limp, a, b ] )
We're going to check another condition as well, and we need to check that both are true, so type AND after the database field we just inserted, so that it looks like this:
sum( if[ holdem_hand _player_statistics.flg_p_limp AND , a, b ] )
Put a space after the AND as well, and leave the cursor just before the comma then click Insert again so that we can add the next part of the expression.
This time we're going to check for the player folding after limping. The best way to do this is by seeing if their preflop actions were exactly call then fold, which means that their action string would be 'CF'.
Find the preflop action string in the Database Fields tab of the Insert window. The Table Name is lookup_actions_p and the Field Name is action so select that and click OK.
The expression should now look like this:
sum( if[ holdem_hand _player_statistics.flg_p_limp AND lookup_actions_p.action, a, b ] )
To see if the actions were call then fold enter = 'CF' after the action field we just inserted so that the expression looks like this:
sum( if[ holdem_hand _player_statistics.flg_p_limp AND lookup_actions_p.action = 'CF', a, b ] )
To complete the expression we now need to replace 'a' with 1 and 'b' with 0 so that the IF statement will return 1 if both conditions are true and 0 if either is false, allowing the SUM function to add up the 1s and 0s to give a count.
Tip! For more information on action strings and the 1, 0 part of the IF statement see Constructing Column Expressions earlier in this tutorial.
The final expression should now look like this:
To complete the Statistic enter a Description - I'm entering "The number of times the player limped and then folded preflop."
The Group By option should be unchecked, and the Summary Type should be set to Sum.
Click the Save button to store the column.