Skip to main content

BriefCam User Guide

Useful Expressions

Last Updated: 7 minute read
Version2025r1
LanguageEnglish

Below are a number of examples of expressions that you can use to customize your dashboards.

Count Expressions
Count the Number of Objects

For Aggregated dashboards 

For Detailed dashboards 

sum({$<[Class Category ID]={Category ID}>}TotalObjects) 

count({$<[Class Category ID]={Category ID}>}ObjectID) 

Where:

Category ID 

Category 

0

People 

1

Bicycles 

2

Road Vehicles 

3

Other Vehicles 

4

Animals 

5

Illumination Changes 

For example:

  • People counting for aggregated dashboards: sum({$<[Class Category ID]={0}>}TotalObjects)

  • People counting for detailed dashboards: count({$<[Class Category ID]={0}>}ObjectID)

In the chart below, you can see which classes are included in each of the categories:

Class Category table.png
Count the Number of People
  • From 60 days ago: 

For Aggregated dashboards 

For Detailed dashboards 

sum({<[Class Category ID]={0}, Date={"$(=Date(Today()-60,'DD/MM/YYYY'))"}>} TotalObjects) 

count({<[Class Category ID]={0}, Date={"$(=Date(Today()-60,'DD/MM/YYYY'))"}>} ObjectID) 

Note that in the examples where the name Entry is used, it is given as an example of the name of a custom dimension. You can replace this with the name of any of your custom dimensions.

  • In an area called Entry: 

For Aggregated dashboards 

For Detailed dashboards 

sum({$<[Class Category ID]={0},[Path & Area]={'Entry'}>} TotalObjectsCustomDimension) 

count({$<[Class Category ID]={0},[Path & Area]={'Entry'}>}ObjectID) 

  • From the previous seven days (last week) in an area called Entry:

For Aggregated dashboards 

For Detailed dashboards 

sum({<[Class Category ID]={0}, [Path & Area]={'Entry'}, Date={">=$(=Date(Today()-7,'DD/MM/YYYY'))"}>} TotalObjectsCustomDimension) 

count({<[Class Category ID]={0}, [Path & Area]={'Entry'}, Date={">=$(=Date(Today()-7,'DD/MM/YYYY'))"}>} ObjectID) 

  • From the last two weeks in an area called Entry: 

For Aggregated dashboards 

For Detailed dashboards 

sum({<[Class Category ID]={0}, [Path & Area]={'Entry'}, Date={">=$(=Date(Today()-14,'DD/MM/YYYY')) "}>} TotalObjectsCustomDimension) 

count({<[Class Category ID]={0}, [Path & Area]={'Entry'}, Date={">=$(=Date(Today()-14,'DD/MM/YYYY')) "}>} ObjectID) 

  • From two weeks ago until one week ago in an area called Entry: 

For Aggregated dashboards 

For Detailed dashboards 

sum({<[Class Category ID]={0}, [Path & Area]={'Entry'}, Date={">=$(=Date(Today()-14,'DD/MM/YYYY'))<=$(=Date(Today()-7,'DD/MM/YYYY'))"}>} TotalObjectsCustomDimension)

count({<[Class Category ID]={0}, [Path & Area]={'Entry'}, Date={">=$(=Date(Today()-14,'DD/MM/YYYY'))<=$(=Date(Today()-7,'DD/MM/YYYY'))"}>} ObjectID) 

For example, if today is 20/8/2020 and the expression is run, it will count people from 6/8/2020 (>today-14) until 13/8/2020 (<today-7).

  • From watchlists who visited the Left Wing camera and the Exit 1 camera, but not Entrance 2 camera: 

For Aggregated dashboards 

For Detailed dashboards 

N/A

Count(DISTINCT {$<Identity = P({<[Source] = {'Left Wing'}>}) * P({<[Source] = {'Exit 1'}>}) - P({<[Source] = {'Entrance 2'}>})>} Identity) 

Note that if the word DISTINCT occurs before the function arguments, duplicates resulting from the evaluation of the function arguments are disregarded.

  • In Camera 4 in the “Entry” path together with the number of people in Camera 15 in all paths and areas except the “Passing by” path: 

For Aggregated dashboards 

For Detailed dashboards 

sum({$<Source={'Cam 4'},[Class Category ID]={0}, [Path & Area]={'Entry'}>} TotalObjectsCustomDimension)+ sum({$<Source={'Cam 15'},[Class Category ID]={0}, [Path & Area]-={'Passing by'}>} TotalObjectsCustomDimension) 

count({$<Source={'Cam 4'},[Class Category ID]={0}, [Path & Area]={'Entry'}>}ObjectID)+count({$<Source={'Cam 15'},[Class Category ID]={0}, [Path & Area]-={'Passing by'}>}ObjectID) 

  • Who are employees (based on the watchlist named Employees): 

For Aggregated dashboards 

For Detailed dashboards 

N/A

Count(DISTINCT {$<[Watchlist]={'Employees'},[Class Category ID]={0}>} FaceID) 

  • In the “Entry” area (not including employees on the “Employees” watchlist): 

For Aggregated dashboards 

For Detailed dashboards 

N/A

Count(DISTINCT {$<[Path & Area]={'Entry'},[Class Category ID]={0},[Watchlist]-={'Employees'}>}FaceID) 

  • Counts objects that moved in a direction higher than 299.5 or lower than 60.5: 

For Aggregated dashboards 

For Detailed dashboards 

N/A

count({$<[Direction]={">=299.5<=60.5"}>}ObjectID) 

Date and Time Expressions
  • Number of days in the current year and month with more than 1000 people: 

For Aggregated dashboards 

For Detailed dashboards 

=sum(aggr({$<[Class Category ID]={0},Year={$(=Year(Today()))},[Month Num]={$(=Month(Today())+0)}>}if(sum(TotalObjects) > 1000,1,0),Date)) 

=sum(aggr({$<[Class Category ID]={0},Year={$(=Year(Today()))},[Month Num]={$(=Month(Today())+0)}>}if(count(ObjectID) > 1000,1,0),Date)) 

  • Number of days in the entire time range that have more than 1000 people: 

For Aggregated dashboards 

For Detailed dashboards 

=sum(aggr({$<[Class Category ID]={0}>}if(sum(TotalObjects) > 1000,1,0),Date)) 

=sum(aggr({$<[Class Category ID]={0}>}if(count(ObjectID) > 1000,1,0),Date)) 

  • Time gap between last two persons in same camera and day: 

This is relevant, for example, to make sure that the last two employees in the branch are not walking out together.

For Aggregated dashboards 

For Detailed dashboards 

N/A

  • Last object: firstsortedvalue([End Time], -[End Time],1) 

    Second last object: firstsortedvalue([End Time], -[End Time],2) 

    Gap: firstsortedvalue([End Time], -[End Time],1) - firstsortedvalue([End Time], -[End Time],2) 

  • 10-minute increments of time between the hours of 4am and 8am: 

For Aggregated dashboards 

For Detailed dashboards 

N/A

=if(Time >= 4/24 and Time <=8/24,time([10 Min],'$(vTimeFormat)')) 

  • Automatically open a sheet to show today and the previous seven days: 

  1. In the Sheet properties, open the Action section.

  2. From the Action property, select Select values matching search criteria.

  3. From the Field property, select Date.

  4. In the Value property, enter: ='>=' & Date(Today()-7) & '<=' & Date(Today())

    Show today expression.png
  • Ensure a chart starts with the proper days of the week order: 

    1. Click on the chart that includes days.

    2. From the chart’s properties, select the Sorting section.

    3. Select a dimension that includes Day.

    4. Make sure the Sort by expression is checked.

    5. Make sure the order is set to Ascending.

    6. In the Expression property, enter the following: match(Day, 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun')

      Match days expression.png
Expressions for Maximums and Minimums

Note that if the word DISTINCT occurs before the function arguments, duplicates resulting from the evaluation of the function arguments are disregarded.

  • Max People/Hour (multiple Path & Area) 

For Aggregated dashboards 

For Detailed dashboards 

max(aggr(sum({$<[Class Category ID]={0},[Path & Area]={ 'custom_dimension_name_A ', 'custom_dimension_name_B'}>} TotalObjectsCustomDimension), [Hour (hh)],Date)) 

max(aggr(count({$<[Class Category ID]={0},[Path & Area]={ ' custom_dimension_name_A ', ' custom_dimension_name_B '}>}ObjectID),Hour,Date)) 

  • Maximum number of visitors per hour on a daily basis (not including employees on the “Employees” watchlist): 

For Aggregated dashboards 

For Detailed dashboards 

N/A

max(aggr(count({$<[Path & Area]={'C-01-PC-OverHeadEntr'},[Class Category ID]={0}>}ObjectID) - (count(distinct {$<[Watchlist]={'Employees'},[Class Category ID]={0}>} FaceID)),Hour,Date)) 

  • Minimum number of visitors per hour on a daily basis (not including employees on the “Employees” watchlist): 

For Aggregated dashboards 

For Detailed dashboards 

N/A

if (Min(aggr(count({$<[Path & Area]={'C-01-PC-OverHeadEntr'},[Class Category ID]={0}>}ObjectID) - (count(distinct {$<[Watchlist]={'Employees'},[Class Category ID]={0}>} FaceID)),Hour,Date)) < 0 , 0, Min(aggr(count({$<[Path & Area]={'C-01-PC-OverHeadEntr'},[Class Category ID]={0}>}ObjectID) - (count(distinct {$<[Watchlist]={'Employees'},[Class Category ID]={0}>} FaceID)),Hour,Date)) ) 

Expressions for Averages
  • Average number of people per day in custom dimension named Entry: 

For Aggregated dashboards 

For Detailed dashboards 

avg(Aggr((sum({<[Path & Area]={'Entry'}>} TotalObjectsCustomDimension)),Day)) 

avg(Aggr((count({<[Path & Area]={'Entry'}>}[ObjectID])),Day)) 

  • Average number of people per hour in custom dimension named Entry: 

For Aggregated dashboards 

For Detailed dashboards 

avg(Aggr((count({<[Path & Area]={'Entry'}>}[ObjectID])),Date,Hour)) 

avg(Aggr((count({<[Path & Area]={'Entry'}>}[ObjectID])),Date,Hour)) 

  • Average number of people every 10 minutes: 

For Aggregated dashboards 

For Detailed dashboards 

N/A

avg(Aggr((count({<[Class Category ID]={0}>}[ObjectID])),Date,[10 Min])) 

  • Average number of times there were 50+ people within 10 minutes: 

For Aggregated dashboards 

For Detailed dashboards 

N/A

sum(aggr(if(avg(Aggr((count({<[Class Category ID]={0}>}[ObjectID])),Date,[10 Min])) > 50,1,0),Date,[10 Min])) 

  • Top 10 Sources according to the longest Avg dwell time (people only), per max date: 

  1. Add a Bar chart with one of the below measure’s expressions (per your need):

    • Measure expression for Avg dwell time (people only), across all dates:

      For Aggregated dashboards: sum({$<[Class Category ID]={0}>}WeightedAvgDwellSec) / sum({$<[Class Category ID]={0}>}TotalObjects 

      For Detailed dashboards: Avg({$<[Class Category ID]={0}>}[Dwell (Sec)]) 

    • Measure expression for Avg dwell time (people only), per max date:

      For Aggregated dashboards: Avg({$<[Class Category ID]={0},[Date]={"$(=Max(Date))"}>}[Dwell (Sec)]) 

      For Detailed dashboards: sum({$<[Class Category ID]={0},[Date]={"$(=Max(Date))"}>}WeightedAvgDwellSec) / sum({$<[Class Category ID]={0},[Date]={"$(=Max(Date))"}>}TotalObjects) 

  2. Change the name of the measure to Avg Dwell.

  3. Add a Dimension and select Source.

  4. Add a limitation on the Source Dimension to set top 10 Sources as shown in the image below.

    Top 10 sources 1.png
  5. Sort the chart by the expression (by having the Avg Dwell measure as the first item in the Sorting list).

    Top 10 sources 2.png
  6. See the result:

    Top 10 sources 3.png
Exclusion Expressions
  • Exclude specific custom dimensions: 

For Aggregated dashboards 

For Detailed dashboards 

sum({<[Class Category ID]={0},[Path & Area]-={'custom_dimension_name'}>}TotalObjectsCustomDimension) 

count({<[Class Category ID]={0},[Path & Area] -= {' custom_dimension_name '}>}[ObjectID]) 

  • Exclude weekends for ‘On-Demand’ Mon-Fri scheduling. 

For Aggregated dashboards 

For Detailed dashboards 

=if (Weekday(Date(Today()))=0,Date(Today()-3),Date(Today()-1)) 

=if (Weekday(Date(Today()))=0,Date(Today()-3),Date(Today()-1)) 

Note

To remove gender from graphs, replace vClass with vClassCategory.

Vehicle Expressions
  • Bicycle Counting – Counts bicycles only:

For Aggregated dashboards 

For Detailed dashboards 

sum({$<[Class Category ID]={1}>} TotalObjects) 

count({$<[Class Category ID]={1}>}ObjectID) 

  • Road Vehicle Counting – Counts the following classes: Bus, Car, Motorcycle, Pickup Truck, Truck, and Van:

For Aggregated dashboards 

For Detailed dashboards 

sum({$<[Class Category ID]={2}>} TotalObjects) 

count({$<[Class Category ID]={2}>}ObjectID) 

  • Other Vehicle Counting – Counts the following classes: Airplane, Boat, and Train:

For Aggregated dashboards 

For Detailed dashboards 

sum({$<[Class Category ID]={3}>} TotalObjects) 

count({$<[Class Category ID]={3}>}ObjectID) 

  • Vehicle U-turn counts from the previous 7 days: 

For Aggregated dashboards 

For Detailed dashboards 

sum({<[Class Category ID]={2}, [Path & Area]={'U-Turn'},Date={">=$(=Date(Today()-7,'DD/MM/YYYY'))"}>} TotalObjectsCustomDimension) 

count({<[Class Category ID]={2}, [Path & Area]={'U-Turn'},Date={">=$(=Date(Today()-7,'DD/MM/YYYY'))"}>} ObjectID) 

  • Vehicle U-turns per hour: 

For Aggregated dashboards 

For Detailed dashboards 

sum(Aggr((count({<[Class Category ID]={2}, [Path & Area]={'U-Turn'}>} TotalObjectsCustomDimension)),Date, [Hour (hh)])) 

Count(Aggr((count({<[Class Category ID]={2}, [Path & Area]={'U-Turn'}>}[ObjectID])),Date,Hour)) 

  • Duration for date per LPR: 

For Aggregated dashboards 

For Detailed dashboards 

N/A

Interval(avg(Aggr((max({<[LPR]-={''}>}[End Time])-min({<[LPR]-={''}>}[Start Time])),GroupID,LPR,Date)))