This function will likely be the most commonly used function. It counts the number of clips in the dataset which match the clip row name and any relevant search criteria. The search criteria can include an array of qualifiers and attributes.
Basic format: ["count_clips", "row_name", [search_criteria], "start_time", "end_time" ]
In the following example, we want to know how many shots the opposition had during the game. The count_clips function works by calculating how many clips in the timeline exist in the "Opposition Shots" row. By leaving the search_criteria blank, the function will not concern itself with filtering the results by qualifier or attribute.
e.g: ["count_clips", "Opposition Shots", [] ]
Now we want to know how many shots ON TARGET the opposition had. The count_clips function works by calculating how many clips in the timeline exist in the "Opposition Shots" row which include a qualifier with the qualifier name, "On Target", and qualifier category "Outcome".
e.g: ["count_clips", "Opposition Shots", [{"Outcome": "On Target"}]
What if we want to know how many shots on target the opposition had during the game which were from Rex? Now, Rex is a second qualifier so our next example shows how we can query the dataset for two qualifiers.
e.g: ["count_clips", "Opposition Shots", [{"Outcome": "On Target"}, {"Player": "Rex"}]
Finally, what if we wanted to know how many shots on target the opposition had during the game which were saved by the goalkeeper AND the shot came from Rex? Firstly we need to understand how this data is represented in our dataset. In our fictional dataset, this is an attribute of the "On Target" qualifier. The example below shows how we can query the dataset for two qualifiers where one also has an attribute:
e.g: ["count_clips", "Opposition Shots", [{"Outcome": "On Target", "attributes": {"GK Save": "Saved"}}, {"Player": "Rex"}]
As you can see there is lots of potential to query your data using this function. The best part is that once you understand this structure, almost every variable function that you can use with Fulcrum HTML reports uses this search_criteria format. In JSON terminology this is known as an "array of objects".
You can even try putting "" as the row_name and the function will search in ALL clips regardless of their name! Now... have a go yourself and see what you can produce!
You can also define a start and end time which is also useful with the min_time_start and max_time_end functions - ensure you define the timing variables before you use them in this function.