this.add("dur_hours") {(this["duration_minutes"] as Long).toDouble() / 60.0 } .groupBy { "month"<Int>() } .aggregate { sum { "dur_hours"<Double>() } into "total_hours" } .sortBy("month") .add("season") { when (this["month"] as Int) { 12, 1, 2 -> "Winter" 3, 4, 5 -> "Spring" 6, 7, 8 -> "Summer" else -> "Fall" }