Skip to main content
Solved

Group by Address and create min max attributes


Forum|alt.badge.img

I'm hoping someone could help me figure out the best way to group a dataset by address and create min/max attributes to use later in the workspace.

I have multiples of same address(es) with policy effective and expiration dates

I've used aggregator to successfully group and create a count (so I know how many of same address are in the dataset)

What I want to do also is create a min effective date and max expiration date for each address and somehow calculate the time between these dates or at least determine if it is >3 years.

Appreciate any pointers :)

Best answer by todd_davis

example.zip

Instead of using the aggegator, how about pass it to the statisticscalculator. You need to make sure your date is in an appropriate Date format (YYYYMMDD). In stats calc, set you grouping to what you had in the aggregator. Analyze the date field. You can then get min, max and count of the dates. Then you can use datedifferencecalculator to get the difference....Example attached

Otherwise you cold create lists in the aggregator and listsorter them. Use the list indexer to create attribute in for high and low date, and then datedifferencecalulator to get the difference.

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

2 replies

todd_davis
Supporter
Forum|alt.badge.img+21
  • Supporter
  • Best Answer
  • July 22, 2016

example.zip

Instead of using the aggegator, how about pass it to the statisticscalculator. You need to make sure your date is in an appropriate Date format (YYYYMMDD). In stats calc, set you grouping to what you had in the aggregator. Analyze the date field. You can then get min, max and count of the dates. Then you can use datedifferencecalculator to get the difference....Example attached

Otherwise you cold create lists in the aggregator and listsorter them. Use the list indexer to create attribute in for high and low date, and then datedifferencecalulator to get the difference.


Forum|alt.badge.img
  • Author
  • July 22, 2016
todd_davis wrote:

example.zip

Instead of using the aggegator, how about pass it to the statisticscalculator. You need to make sure your date is in an appropriate Date format (YYYYMMDD). In stats calc, set you grouping to what you had in the aggregator. Analyze the date field. You can then get min, max and count of the dates. Then you can use datedifferencecalculator to get the difference....Example attached

Otherwise you cold create lists in the aggregator and listsorter them. Use the list indexer to create attribute in for high and low date, and then datedifferencecalulator to get the difference.

Thanks Todd, I will try the statisticscalculator, it sounds like that will do it. I formatted the dates and tried the list route with aggregator, created concatenated list for the dates and then split and used the ListRangeExtractor to get min and max. Complicated way to do it but worked! I will try statscalc to see if that will simplify it a bit. Thanks for your help.


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