cancel
Showing results for 
Search instead for 
Did you mean: 

Compare the values of two documents

mayank_singh
New Contributor II

Hi,
I want to compare the values coming from Union Snap. I’ve two input views, both returning the count of documents. Using Filter, I want to check if the count from both sources is similar then apply the following logic, but I’m unable to compare the values between two documents. Can anyone help me create the expression please? In my case there will be only two sources.
image
image

1 ACCEPTED SOLUTION

Since they are separate objects, you have to find a way to combine them into one.
Instead of Union, you can use Join with the following configuration:
image
image
This will merge both objects into one, then you can easily check if countbefore is equal to countafter with the Filter: $['$countbefore'] == $['$countafter']
image

Or, you can use an inner Join instead of the combination with Join + Filter:
image
If their values are the same, there will be an output.

View solution in original post

4 REPLIES 4

j_angelevski
Contributor III

Hi @mayank.singh,

By “similar” count do you mean “same” value in both objects ?

Hi @j.angelevski, Yes same value

Since they are separate objects, you have to find a way to combine them into one.
Instead of Union, you can use Join with the following configuration:
image
image
This will merge both objects into one, then you can easily check if countbefore is equal to countafter with the Filter: $['$countbefore'] == $['$countafter']
image

Or, you can use an inner Join instead of the combination with Join + Filter:
image
If their values are the same, there will be an output.

Thank you very much