{
	"name": "dialog/productivity_report/reduce.json",
	"definition": {
		"develop_chart": {
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "develop_chart"
			},
			"reduce": "combine",
			"combine": ["year_month"],
			"first": ["year_month", "load_group"],
			"sum": ["actual_hour", "planned_hour", "std_time", "work_time", "not_failed", "produced"],
			"sort": ["year_month", ">"]
		},
		"develop_chart_old": {
			"reduce": "combine",
			"combine": ["x"],
			"first": ["x"],
			"avg": ["y"]
		},
		"speed_row_other_lg": {
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "speed_row_other_lg"
			},
			"reduce": "count",
			"unique": "wpa_work_load_group_id"
		},
		"speed_row": {
			"reduce": "combine",
			"combine": ["wpa_production_lot", "wpa_work_phase_est_id"],
			"sum": ["wpa_work_time__amount", "work_time", "std_time"],
			"sum_filterX": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "finished_work_time"
			},
			"sum_filterXX": ["std_time", ">", 0],
			"max": ["estimated_speed_percent", "std_speed_percent"],
			"first": ["wpa_work_phase_est_id", "finished_work_time", "before_time_period_sum", "estimated_work_time", "estimated_work_time__unit", "finished_estimated_work_time", "finished_estimated_work_time__unit", "wos_produced", "wos_failed", "wos_finished", "wpa_record_id", "wpa_production_lot", "wo_drawing_number", "w_name", "wpa_employee_id", "wpa_work_load_group_id"],
			"last": ["after_time_period_sum"]
		},
		"speed_row_all": {
			"reduce": "combine",
			"sort": ["wpa_production_lot", ">", "wpa_work_phase_est_id", ">", "target_date", ">", "wpa_shift_number", ">", "wpa_date_", ">", "wpa_end_time", ">", "wpa_work_load_group_id", ">"],
			"combine": ["wpa_production_lot", "wpa_work_phase_est_id"],
			"sum": ["wpa_work_time__amount", "work_time", "std_time"],
			"unique": ["wpa_work_load_group_id"],
			"max": ["estimated_speed_percent", "std_speed_percent"],
			"first": ["work_time_all", "wpa_work_phase_est_id", "finished_work_time", "before_time_period_sum", "estimated_work_time", "estimated_work_time__unit", "finished_estimated_work_time", "finished_estimated_work_time__unit", "wos_produced", "wos_failed", "wos_finished", "wpa_record_id", "wpa_production_lot", "wo_drawing_number", "w_name", "wpa_employee_id"],
			"last": ["after_time_period_sum"]
		},
		"finished_estimated_work_time": {
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "finished_estimated_work_time"
			},
			"reduce": "sum",
			"field": "finished_estimated_work_time"
		},
		"finished_work_time": {
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "finished_work_time"
			},
			"reduce": "sum",
			"field": "finished_work_time"
		},
		"wpa_produced_amount": {
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "quality"
			},
			"reduce": "sum",
			"field": "wpa_produced_amount"
		},
		"wpa_failed_amount": {
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "quality"
			},
			"reduce": "sum",
			"field": "wpa_failed_amount"
		},
		"wpa_work_time__amount": {
			"reduce": "sum",
			"field": "wpa_work_time__amount"
		},
		"wlg_header": {
			"map": {
				"name": "dialog/productivity_report/map.json",
				"definition": "wlg_header"
			},
			"reduce": "first",
			"field": "wlg_header",
			"default": ""
		},
		"finished_repair_amount": {
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "finished_reclamation"
			},
			"reduce": "sum",
			"field": "rcl_repair_amount"
		},
		"finished_rejected_amount": {
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "finished_reclamation"
			},
			"reduce": "sum",
			"field": "rcl_rejected_amount"
		},
		"capacity_shift": {
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "capacity_shift"
			},
			"reduce": "sum",
			"field": "hours"
		},
		"planned_hour": {
			"info": "currently same as capacity",
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "capacity"
			},
			"reduce": "sum",
			"field": "hours"
		},
		"actual_hour": {
			"info": "AGA: fix, map to new field setup time + work time?, MUST divide by shift",
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "capacity_work_time"
			},
			"reduce": "sum",
			"field": "wpa_work_time__amount"
		},
		"actual_machine_hour": {
			"info": "actual_machine_hour",
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "capacity_work_time"
			},
			"reduce": "sum",
			"field": "wpa_machine_hours"
		},
		"unproductive_hour": {
			"info": "unproductive_hour",
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "capacity_unproductive_work_time"
			},
			"reduce": "sum",
			"field": "wpa_work_time__amount"
		},
		"rcl_repair_amount": {
			"reduce": "sum",
			"field": "rcl_repair_amount"
		},
		"rcl_rejected_amount": {
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "rcl_rejected_amount"
			},
			"reduce": "sum",
			"field": "rcl_rejected_amount"
		},
		"track_time_asked_counter": {
			"reduce": "count",
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "track_time_asked"
			}
		},
		"track_time_measured_counter": {
			"reduce": "count",
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "track_time_measured"
			}
		},
		"track_time_changed_counter": {
			"reduce": "count",
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "track_time_changed"
			}
		},
		"track_time_changed_percent": {
			"reduce": "sum",
			"filter": {
				"name": "dialog/productivity_report/filter.json",
				"definition": "track_time_changed"
			},
			"field": "track_time_change_percent"
		}
	}
}