Skip to main content
Solved

Sort AttributePivoter Output


Forum|alt.badge.img

Hello...I would like to sort the output of the Attributepivoter. Is this possible? For example, one of the group by rows is month and I want to sort this output based on the calendar year months (Jan. to December). Thanks.

Best answer by takashi

Hi @aviveiro, if you create another attribute that stores a date string (e.g. April/01/2017) containing the MONTH_NFI value, you can use the DateTimeConverter to convert it to a number 1 - 12 representing the order of the month in a year (e.g. 4). You can then sort the features with the Sorter.

DateTimeConverter Setting Example

  • Input Format: %B/%d/%Y
  • Output Format: %N

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

2 replies

takashi
Evangelist
  • Best Answer
  • December 8, 2017

Hi @aviveiro, if you create another attribute that stores a date string (e.g. April/01/2017) containing the MONTH_NFI value, you can use the DateTimeConverter to convert it to a number 1 - 12 representing the order of the month in a year (e.g. 4). You can then sort the features with the Sorter.

DateTimeConverter Setting Example

  • Input Format: %B/%d/%Y
  • Output Format: %N


Forum|alt.badge.img
  • Author
  • December 8, 2017
takashi wrote:

Hi @aviveiro, if you create another attribute that stores a date string (e.g. April/01/2017) containing the MONTH_NFI value, you can use the DateTimeConverter to convert it to a number 1 - 12 representing the order of the month in a year (e.g. 4). You can then sort the features with the Sorter.

DateTimeConverter Setting Example

  • Input Format: %B/%d/%Y
  • Output Format: %N

Hi @takashi. Thank you for your response. I did as you suggested, however, found that sorting on the new numeric date field representing month (e.g. 5) didn't work because the field being used in the AttributePivoter was the month name (e.g. May). I checked the data and it was sorted properly from lowest month (4) to highest (9); however, that had no impact on the AttributePivoter output. Your response got me on the right track though, as I used the DateTimeConverter to output both the digit month (%N) and month name (%B), i.e., %N - %B. This resulted in values such as 4 - April, 5 - May, etc. in the new field that when sorted were properly reflected in the AttributePivoter output. Thanks again.

 


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