def aggPer = getAggregationPeriod();
def adjAggPer = if aggPer == AggregationPeriod.MIN then
AggregationPeriod.THREE_MIN
else if aggPer == AggregationPeriod.TWO_MIN then
AggregationPeriod.FIVE_MIN
else if aggPer == AggregationPeriod.THREE_MIN then
AggregationPeriod.TEN_MIN
else if aggPer == AggregationPeriod.FOUR_MIN then
AggregationPeriod.TEN_MIN
else if aggPer == AggregationPeriod.FIVE_MIN then
AggregationPeriod.FIFTEEN_MIN
else if aggPer == AggregationPeriod.TEN_MIN then
AggregationPeriod.THIRTY_MIN
else if aggPer == AggregationPeriod.FIFTEEN_MIN then
AggregationPeriod.HOUR
else if aggPer == AggregationPeriod.TWENTY_MIN then
AggregationPeriod.HOUR
else if aggPer == AggregationPeriod.THIRTY_MIN then
AggregationPeriod.TWO_HOURS
else if aggPer == AggregationPeriod.HOUR then
AggregationPeriod.FOUR_HOURS
else if aggPer == AggregationPeriod.TWO_HOURS then
AggregationPeriod.DAY
else if aggPer == AggregationPeriod.FOUR_HOURS then
AggregationPeriod.DAY
else if aggPer == AggregationPeriod.DAY then
AggregationPeriod.THREE_DAYS
else if aggPer == AggregationPeriod.TWO_DAYS then
AggregationPeriod.WEEK
else if aggPer == AggregationPeriod.THREE_DAYS then
AggregationPeriod.WEEK
else if aggPer == AggregationPeriod.FOUR_DAYS then
AggregationPeriod.MONTH
else if aggPer == AggregationPeriod.WEEK then
AggregationPeriod.MONTH
else if aggPer == AggregationPeriod.MONTH then
AggregationPeriod.MONTH
else
Double.NaN;