Skip to main content
Similar to the way the new StatisticsCalculator can do a "GroupBy" is there a way to set the ExpressionEvaluator to "GroupBy" as well.

 

 

I have a set of features that I want to do some trigonometry calculations on and the "cumulative" feature of the StatisticsCalculator would be absolutely perfect if I could have a field where I could do advanced math or open the "Arithmetic Calculator." 

 

 

Just as a bit of background, I am creating a wellbore path from trajectory data. For example, I have a starting XY coordinate, and a direction and inclination. I want to "cumulatively" calculate from the previous feature/row, but only for the specific well (ie where the GroupBy functionality would come into play.)

 

 

There are an ever changing number of wellbore surveys being added to the database and I need to generate these constantly. I have the general trigonometry down but I don't know how to GroupBy or iterate over each "UniqueID."

 

 

Any help would be appreciated.

 

 

 

 

Hi Matthew,

 

 

"Mltiple Feature Attribute Support" and "Conditional Value" options of the AttributeCreator might help you. If you enable "Multiple Feature AttributeSupport" option and specify 1 to "Number of Prior Features" parameter, you can access attributes of the previous feature with the syntax "featurer-1].<attribute name>" in the AttributeCreator.

 

  Assume every feature has GroupID and RowNumber attributes. This workflow example calculates the cumulative total of calculating result, grouping by GroupID.

 

1) The Sorter arranges the order of features by GroupID and RowNumber. If the reading order is so, it's not essential. 2) The 1st AttributeCreator creates 2 attributes: CumulativeTotal = <value will be set by the 2nd AttributeCreator> Result = <arithmetic calculation result on the current feature> 3) The 2nd AttributeCreator calculates CumulativeTotal. Set this value using "Set To Conditional Value" option. If GrouopID of the current feature is equal to the previous feature's:     CumulativeTotal = "CumulativeTotal of the previous feature" + Result Else:     CumulativeTotal = Result

 

Hope this helps.

 

Takashi
Although it may be a little to simplistic to do what you need, I was often able to do similar tasks using the aggregator's grouping and sum functionality.
Hi Takashi,

 

 

I believe this is going to do the trick... Still working out some bugs but the results are starting to come out more like I expected.

 

 

Thanks!

Reply