Internal documentation only
This page has been marked as draft.
How to count number of occurrences of given value in output
Related to Copied
This documentation addresses the configuration of headline variables to perform conditional counts on specific column data. Specifically, it covers how to aggregate and display the totals of distinct cell values—such as “attached” and “detached” statuses—from a dataview column into separate, dedicated headline cells for real-time tracking.
Problem Copied
The user is experiencing difficulty configuring Gateway headlines to dynamically count and display specific string values within a dataview column. The primary challenge involves creating a distribution logic where the system distinguishes between two distinct states (“attached” and “detached”) and populates two separate headlines with their respective totals. Without the correct syntax, the headlines fail to increment based on the specific cell content, resulting in inaccurate or empty summary data in the user interface.
Possible causes Copied
- Root Cause 1: Absence of conditional logic or filters in the headline variable definition.
- Root Cause 2: Improperly configured XPaths that target the entire column rather than specific cell attributes.
- Root Cause 3: Misunderstanding of the
wcountor aggregation functions required for status-based distribution.
Possible solutions Copied
- Solution Root Cause 1: Implement a conditional count formula in the headline. Define two separate headlines—one for “Attached” and one for “Detached”—using a formula that specifies which string to look for in each instance.
- Solution Root Cause 2: Utilize XPath filtering within the headline configuration.
- Solution Root Cause 3: Verify the Sampler configuration to ensure the headline is set to “Computed” and that the update interval is synchronized with the dataview refresh, ensuring the distribution remains accurate as statuses change.
Replication steps Copied
As you can see above, I managed to count the attached and detached. Please see how I can achieve that:
- Create the headlines here:
- I made two different rules for the attached and detached.
- Create a “path aliases” for attached and detached.
- Copy the path of your headline (attached and detached).
- Paste it into the Target
- Apply the rule that comes from this article - Geneos - How do I get the total number of rows returned in a rule? (rowcount)
Note: Please change the variables based on what you declared on the “PathAliases”
Then you can check how many counts are on the attached and detached. Upon testing it,
Complete view - Tried to add the word “detached”
![]()
Will replaced the last detached with the attached.
The replication XML is attached for reference.