Skip to main content

User Guide

Count the number of times a specific event has occurred within another event

This is a workaround since you do not have the ability to control the bin size in the search results. Assuming you can do a search result to find your event for which you want to find the number of times another event occurred, e.g., a valve has opened.

  1. Create a new Tag Builder Formula to count the number of times e.g., a valve tag changes to open from any other state that is not open (valve is closed when 0 and opened when 1). 

    Formula:

    if(and(A=1, A=B, C<>A), 86400, 0)

     Variable mapping:  

    A = Event-Tag 

    B = Event-Tag, shifted by 1 second (x seconds) 

    C = Event-Tag, shifted by 2 seconds (2*x seconds) 

    A1_Count_the_number_of_times_a_specific_event_has_occurred_within_another_event.png
  2. Now a value-based search can be performed and the integral for each search result can be get.

    A2_Count_the_number_of_times_a_specific_event_has_occurred_within_another_event.png
    A3_Count_the_number_of_times_a_specific_event_has_occurred_within_another_event.png
    A4_Count_the_number_of_times_a_specific_event_has_occurred_within_another_event.png
  3. It is also possible to use the statistics table get the number of events directly from the integral there. You can zoom into any area and quickly see the number of events across that period.

    A5_Count_the_number_of_times_a_specific_event_has_occurred_within_another_event.png