Solved

Group by Address and create min max attributes

  • 22 July 2016
  • 2 replies
  • 15 views

Badge

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 :)

icon

Best answer by todd_davis 22 July 2016, 05:10

View original

2 replies

Userlevel 1
Badge +12

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.

Badge

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