WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats

Segmenter::segment_selections_orders() protected WC 1.0

Returns column => query mapping to be used for order-level segmenting query (e.g. discount amount when segmented by coupons).

{} It's a method of the class: Segmenter{}

No Hooks.

Return

Array. Column => SELECT query mapping.

Usage

// protected - for code of main (parent) or child class
$result = $this->segment_selections_orders( $coupons_lookup_table, $overrides );
$coupons_lookup_table(string) (required)
Name of SQL table containing the order-level info.
$overrides(array)
Array of overrides for default column calculations.

Code of Segmenter::segment_selections_orders() WC 5.3.0

<?php
protected function segment_selections_orders( $coupons_lookup_table, $overrides = array() ) {
	$columns_mapping = array(
		'amount'        => "SUM($coupons_lookup_table.discount_amount) as amount",
		'coupons_count' => "COUNT(DISTINCT $coupons_lookup_table.coupon_id) as coupons_count",
		'orders_count'  => "COUNT(DISTINCT $coupons_lookup_table.order_id) as orders_count",
	);

	if ( $overrides ) {
		$columns_mapping = array_merge( $columns_mapping, $overrides );
	}

	return $columns_mapping;
}