Filters
Do you want to see all your push-draw shots, or the top-10 shots with your driver? The filters mechanism makes that easy. In the selection bar there is a block called Apply filter. By clicking the button you can define the filter.
A filter is a formula that should result in a Boolean value (true or false). In the filter formula you can refer to the metrics in the shot by using the metric name without spaces. You can also use the button below the formula to add a particular column name.
Some example filters
Let us look at some examples:
- TotalDistance > 200 This filter will select all shots for which the total distance is larger than 200.
- 75 < ClubHeadSpeed < 85 and SmashFactor > 1.3 This will result in all shots where the club head speed was between 75 and 80 and the smash factor was at least 1.3.
- ClubType == "7 Iron" This select all shots with the 7 Iron club type. Note that the type is a string that must be placed between quotes and that we use == for equality, not a single =.
There are also many functions available. For example:
- abs(TotalDeviationDistance) < TotalDistance/10 This will select all shots for which the absolute value of the total deviation distance is at most 1/10th of the total distance.
Sometimes you want to refer to the average value of a metric. Here are some examples:
-
BallSpeed > BallSpeed.average() This will select all shots where the ball speed was larger than the average ball speed over all shots.
-
TotalDistance > TotalDistance .club_average() This is similar, but this time we compare the total distance with the average total distance of shots with the same club.
Besides average you can also use the minimum, maximum, a percentile, and a lot more.
For a complete description of formulas and all the functions, see the help on formulas.
The formula editor
Note that while you type in a formula, a pop-up menu will appear with possible auto-completions. This includes all column names you can use, functions, and so on. Also note that the formula will have color coding. The following colors are used:
- Blue: column names and constants.
- Yellow: function names.
- Orange: strings.
- Green: macro names (see below).
This will help you avoiding mistakes. Below the formula there is a Test button. This will run the formula on all shot and reports the result. When there is an error in the formula, this is also reported. Best always test your formulas.
Tags
Each shot has a column called Tags. This is used to store tags and keywords. In the shot table component you can select shots and them give them tags. To select shots with particular tags you can again use a filter. You can use standard functionality, like contains(Tags, "great") to show all shots where the Tags column contains the word great. But there is some special functionality to deal with tags. The Tags field can contain multiple tags, separated by commas, and the following functions can be used:
- has_tag("Great") selects all shots that have the tag "Great".
- has_some_tags("Good", "Great") selects all shots that have the tag "Good" or "Great" (or both).
- has_all_tags("Good", "Special") selects all shots that have both the tag "Good" and "Special".
- has_none_tags("Good", "Great") selects all shots that have neither the tag "Good" nor "Great".
For more information, see the help on tags.
Macros
When you want to use a filter regularly, you can define it as a macro and give it a name. You can then easily apply it later. To this end, select Define macros from the settings menu. This bring you to a dialog. At the left there are the defined macros. When you select a macro, at the right the macro formula is shown. You can easily add macros and change them.
To use a macro you simply put the name in the formula (without spaces). So if you define macros Long Shot and Short Shot to select the long and short shots, you can use as a filter not LongShot and not ShortShot to get the shots that are neither long nor short.
Combination with other selections
When you specified other selections in the selection bar, they will also be applied. The filter will be applied last! This can lead to unexpected results. For example, if you specify a date period in your filter, but also a period in the date selection, only the shots in both periods are shown. In such a case, simple remove the checkmark for date selection (and/or club selection).
Note that there is also a checkmark before the Apply filters. This allows you to quickly turn selection based on filters on or off, without the need to clear the filter formula.