# How to compare two dataviews by matching the row name?

**URL:** <https://community.itrsgroup.com/t/how-to-compare-two-dataviews-by-matching-the-row-name/304>\
**Category:** Geneos\
**Tags:** active-console\
**Created:** [27 August 2024 07:39 UTC](https://community.itrsgroup.com/t/how-to-compare-two-dataviews-by-matching-the-row-name/304 "2024-08-27T07:39:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhuvan](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@Bhuvan](https://community.itrsgroup.com/u/Bhuvan)\
**Post date:** [27 August 2024 07:39 UTC](https://community.itrsgroup.com/t/how-to-compare-two-dataviews-by-matching-the-row-name/304/1 "2024-08-27T07:39:11Z")

</div>

Hi All,

Does anyone know how to compare a column from two dataviews based on their row name.

Example:

TABLE:1  
Col1. Col2  
A. 2  
B. 5

TABLE2:  
Col1. Col2  
A. 0  
B. 0

Rule should be,

If TABLE1.row1 (A) == TABLE2.row1 then  
If value1 \> 0 or value2 \> 0 then  
Severity ok  
Else  
Severity critical  
Endif  
Endif

This is needed for primary/ secondary server process monitoring. If a process is up in server A then even if the process is down in server B it should be green.

One way of achieving is by creating a new sampler using gateway SQL and pull both the information in one table then compare the values but I would like to do the comparison without any additional sampler.

Other way of doing is creating 10 rules with path alias for dataview with 10 rows one at a time. But this is time consuming and not scalable.

Any help on this would be great 😃

---

<div class="post-metadata">

**Author:** ![pgalbavy](https://dub1.discourse-cdn.com/flex013/user_avatar/community.itrsgroup.com/pgalbavy/32/15_2.png) [@pgalbavy](https://community.itrsgroup.com/u/pgalbavy)\
**Post date:** [27 August 2024 07:43 UTC](https://community.itrsgroup.com/t/how-to-compare-two-dataviews-by-matching-the-row-name/304/2 "2024-08-27T07:43:20Z")

</div>

You can use “path variables” to build a path alias to the other dataview, one per column, and then use something like `count(wpath "alias" value)` to test for existence, and then check the values.

You will probably need to have rules (with slightly different path aliases) on both dataviews and per column, but it should be possible.

You can then also alert if a row is missing from the other view.

Peter

---

<div class="post-metadata">

**Author:** ![Bhuvan](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@Bhuvan](https://community.itrsgroup.com/u/Bhuvan)\
**Post date:** [27 August 2024 15:15 UTC](https://community.itrsgroup.com/t/how-to-compare-two-dataviews-by-matching-the-row-name/304/3 "2024-08-27T15:15:28Z")

</div>

Thanks @pgalbavy  
I’ll give that a try 😊
