Skip to main content
Solved

Row of data with hwy and mp. i want to find unique hwy min(mp) and max(mp) and create a single row.


I have a set of data that contains on each row a highway, start_mp. I want to find, for each highway, the min(start_mp) and the max_start_mp and combine them into a single row of data ordered like: HWY, MIN(START_MP), MAX(START_MP), other attributes.

Best answer by courtney_m

You can do this with a StatisticsCalculator, then an AttributeManager.

In the StatisticsCalculator:

1. Set Attributes to Analyze to start_mp

2. Set a name for Minimum Attribute and Maximum Attribute

3. Then delete the default values for the rest of the Calculate Attributes

The data you want will come out of the Summary port of the StatisticsCalculator - you can connect this port to an AttributeManager to rename and remove attributes as needed.

-Courtney

View original
Did this help you find an answer to your question?

6 replies

courtney_m
Contributor
Forum|alt.badge.img+12
  • Contributor
  • Best Answer
  • August 11, 2017

You can do this with a StatisticsCalculator, then an AttributeManager.

In the StatisticsCalculator:

1. Set Attributes to Analyze to start_mp

2. Set a name for Minimum Attribute and Maximum Attribute

3. Then delete the default values for the rest of the Calculate Attributes

The data you want will come out of the Summary port of the StatisticsCalculator - you can connect this port to an AttributeManager to rename and remove attributes as needed.

-Courtney


courtney_m
Contributor
Forum|alt.badge.img+12
  • Contributor
  • August 11, 2017
courtney_m wrote:

You can do this with a StatisticsCalculator, then an AttributeManager.

In the StatisticsCalculator:

1. Set Attributes to Analyze to start_mp

2. Set a name for Minimum Attribute and Maximum Attribute

3. Then delete the default values for the rest of the Calculate Attributes

The data you want will come out of the Summary port of the StatisticsCalculator - you can connect this port to an AttributeManager to rename and remove attributes as needed.

-Courtney

Also, just so you know, the StatisticsCalculator will send a single record with the statistics attributes out of the Summary port.

 

 


  • Author
  • August 11, 2017

Hi Courtney - thanks for the answer. That gets me closer. I have about 358 unique hwy groups in the load file. What i get now (and it's much closer than before) is the min mp for all of the unique hwy groups and the max mp of all the unique hwy groups. (the same measure for every hwy group). Apologies for not being clearer. These are point assets that cover a mp range of a hwy group and i need to pull the min and max mp for each highway from the load file.


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • August 12, 2017
courtney_m wrote:

You can do this with a StatisticsCalculator, then an AttributeManager.

In the StatisticsCalculator:

1. Set Attributes to Analyze to start_mp

2. Set a name for Minimum Attribute and Maximum Attribute

3. Then delete the default values for the rest of the Calculate Attributes

The data you want will come out of the Summary port of the StatisticsCalculator - you can connect this port to an AttributeManager to rename and remove attributes as needed.

-Courtney

And set the Group by in the StatisticsCalculator at HWY!

 

 


courtney_m
Contributor
Forum|alt.badge.img+12
  • Contributor
  • August 12, 2017
jonlibby wrote:

Hi Courtney - thanks for the answer. That gets me closer. I have about 358 unique hwy groups in the load file. What i get now (and it's much closer than before) is the min mp for all of the unique hwy groups and the max mp of all the unique hwy groups. (the same measure for every hwy group). Apologies for not being clearer. These are point assets that cover a mp range of a hwy group and i need to pull the min and max mp for each highway from the load file.

As @erik_jan mentioned above, set Group By in the StatisticsCalculator to HWY. That will give you the min and max per hwy.

  • Author
  • August 12, 2017

I resolved my issue. Works perfectly. Thanks for the help. Jon.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings