Skip to main content
Solved

Compare attributes

  • August 14, 2018
  • 5 replies
  • 1135 views

mr_fme
Enthusiast
Forum|alt.badge.img+9

I have two data stream, both have count attribute. I would like to compare the count_1 and count_2, if the count_1 > count_2 the set attributes by count_1 go ahead...if count_2 > count_1 the set attributes by count_2 go ahead.

Thank´s

Best answer by takashi

The Tester processes input features one by one, separately. That is, it can compares attribute values within a single feature, it cannot compare attribute values among different features.

I cannot understand your intention correctly from the screenshot, but if you need to select only features that have the max value in 'ATTRIBUTE_1', a possible way is: get the max value in 'ATTRIBUTE_1' with the StatisticsCalculator, merge the Summary feature from the StatisticsCalculator to the original features unconditionally, then test if 'ATTRIBUTE_1' is equal to the max value.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

takashi
Celebrity
  • 7843 replies
  • August 14, 2018
Could you please explain your requirement more specifically?

 

For example, if the first data stream was:

 

count_101234and the second data stream was:

 

count_201234then, what is your desired result?

 

 


siennaatsafe
Safer
Forum|alt.badge.img+12
  • Safer
  • 214 replies
  • August 14, 2018

Hi @mr_fme,

I think I understood what you are asking, but if I missed something please let me know. I created a workspace that combines two excel files with count values into one file and keeps the highest count value. I used an example with fruit to keep in simple. 2018-08-14-15-39-03.png

So the two sheets are read in and I renamed the Count to either Count1 or Count 2.

I joined the tables together so each row would contain the fruit name, Count1, and Count 2.

Then I used the AttributeManager, to create a conditional statement. To do that select the Attribute Value and select the drop-down. Then click Conditional Value and I set it to. If Count1 > Count2 then set the value to Count1. If Count2 > Count1 then set it to Count2. Else (the values are equal) do nothing. 2018-08-14-15-30-14.png

Then I removed Count2 in the AttributeManager.

Let me know if that helps!


mr_fme
Enthusiast
Forum|alt.badge.img+9
  • Author
  • Enthusiast
  • 145 replies
  • August 15, 2018

Let explain more clearly.

My workspace like this

I would like to filter so that the highest number of features always goes ahead. It´s possible!?


takashi
Celebrity
  • 7843 replies
  • Best Answer
  • August 15, 2018

The Tester processes input features one by one, separately. That is, it can compares attribute values within a single feature, it cannot compare attribute values among different features.

I cannot understand your intention correctly from the screenshot, but if you need to select only features that have the max value in 'ATTRIBUTE_1', a possible way is: get the max value in 'ATTRIBUTE_1' with the StatisticsCalculator, merge the Summary feature from the StatisticsCalculator to the original features unconditionally, then test if 'ATTRIBUTE_1' is equal to the max value.


paalped
Contributor
Forum|alt.badge.img+5
  • Contributor
  • 130 replies
  • August 15, 2018

Looks like your looking for FeatureCounter, which counts all features in a stream, you can compare this to numbers of features in another stream.