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.

  • August 11, 2017
  • 6 replies
  • 29 views

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

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.

6 replies

courtney_m
Contributor
Forum|alt.badge.img+20
  • 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+20
  • Contributor
  • 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

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+23
  • Contributor
  • August 12, 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

And set the Group by in the StatisticsCalculator at HWY!

 

 


courtney_m
Contributor
Forum|alt.badge.img+20
  • Contributor
  • August 12, 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.

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.