How to compare two dataviews by matching the row name?

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 :smiley:

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

Thanks @pgalbavy
I’ll give that a try :blush: