{"desc": boolean,// Union field one_order_by can be only one of the following:"metric": {object (MetricOrderBy)},"dimension": {object (DimensionOrderBy)},"pivot": {object (PivotOrderBy)}// End of list of possible types for union field one_order_by.}
Fields
desc
boolean
If true, sorts by descending order.
Union field one_order_by. Specify one type of order by for OrderBy. one_order_by can be only one of the following:
Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" < "b" < "z".
CASE_INSENSITIVE_ALPHANUMERIC
Case insensitive alphanumeric sort by lower case Unicode code point. For example, "2" < "A" < "b" < "X" < "z".
NUMERIC
Dimension values are converted to numbers before sorting. For example in NUMERIC sort, "25" < "100", and in ALPHANUMERIC sort, "100" < "25". Non-numeric dimension values all have equal ordering value below all numeric values.
Used to select a dimension name and value pivot. If multiple pivot selections are given, the sort occurs on rows where all pivot selection dimension name and value pairs match the row's dimension name and value pair.
PivotSelection
A pair of dimension names and values. Rows with this dimension pivot pair are ordered by the metric's value.
For example if pivots = ('browser', 'Chrome') and metricName = "Sessions", then the rows will be sorted based on Sessions in Chrome.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eDefines the available sort options for reporting data, including sorting by metrics, dimensions, or pivot table columns.\u003c/p\u003e\n"],["\u003cp\u003eAllows specifying ascending or descending order for sorting results.\u003c/p\u003e\n"],["\u003cp\u003eEnables sorting by dimension values using alphanumeric, case-insensitive alphanumeric, or numeric ordering.\u003c/p\u003e\n"],["\u003cp\u003eProvides the capability to sort pivot table rows based on a specific metric and a combination of dimension name and value pairs.\u003c/p\u003e\n"],["\u003cp\u003eDescribes the structure and fields required for defining sort criteria in API requests.\u003c/p\u003e\n"]]],["Sorting is enabled via `OrderBy`, which allows sorting by metrics, dimensions, or pivot column groups. `OrderBy` can be set to descending order using the `desc` boolean. Sorting by metrics utilizes `MetricOrderBy` and specifies the `metricName`. `DimensionOrderBy` sorts by a `dimensionName`, with `OrderType` controlling ordering (e.g., alphanumeric, numeric). `PivotOrderBy` uses a `metricName` and `pivotSelections` to sort rows matching specified `dimensionName` and `dimensionValue` pairs within a pivot group. `PivotSelection` needs a dimension and a value.\n"],null,["- [JSON representation](#SCHEMA_REPRESENTATION)\n- [MetricOrderBy](#MetricOrderBy)\n - [JSON representation](#MetricOrderBy.SCHEMA_REPRESENTATION)\n- [DimensionOrderBy](#DimensionOrderBy)\n - [JSON representation](#DimensionOrderBy.SCHEMA_REPRESENTATION)\n- [OrderType](#OrderType)\n- [PivotOrderBy](#PivotOrderBy)\n - [JSON representation](#PivotOrderBy.SCHEMA_REPRESENTATION)\n- [PivotSelection](#PivotSelection)\n - [JSON representation](#PivotSelection.SCHEMA_REPRESENTATION)\n\nThe sort options.\n\n| JSON representation ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"desc\": boolean, // Union field `one_order_by` can be only one of the following: \"metric\": { object (/analytics/devguides/reporting/data/v1/rest/v1alpha/OrderBy#MetricOrderBy) }, \"dimension\": { object (/analytics/devguides/reporting/data/v1/rest/v1alpha/OrderBy#DimensionOrderBy) }, \"pivot\": { object (/analytics/devguides/reporting/data/v1/rest/v1alpha/OrderBy#PivotOrderBy) } // End of list of possible types for union field `one_order_by`. } ``` |\n\n| Fields ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| `desc` | `boolean` If true, sorts by descending order. |\n| Union field `one_order_by`. Specify one type of order by for `OrderBy`. `one_order_by` can be only one of the following: |||\n| `metric` | `object (`[MetricOrderBy](/analytics/devguides/reporting/data/v1/rest/v1alpha/OrderBy#MetricOrderBy)`)` Sorts results by a metric's values. |\n| `dimension` | `object (`[DimensionOrderBy](/analytics/devguides/reporting/data/v1/rest/v1alpha/OrderBy#DimensionOrderBy)`)` Sorts results by a dimension's values. |\n| `pivot` | `object (`[PivotOrderBy](/analytics/devguides/reporting/data/v1/rest/v1alpha/OrderBy#PivotOrderBy)`)` Sorts results by a metric's values within a pivot column group. |\n\nMetricOrderBy Sorts by metric values.\n\n| JSON representation ||\n|----------------------------------|---|\n| ``` { \"metricName\": string } ``` |\n\n| Fields ||\n|--------------|----------------------------------------------------|\n| `metricName` | `string` A metric name in the request to order by. |\n\nDimensionOrderBy Sorts by dimension values.\n\n| JSON representation ||\n|--------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"dimensionName\": string, \"orderType\": enum (/analytics/devguides/reporting/data/v1/rest/v1alpha/OrderBy#OrderType) } ``` |\n\n| Fields ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| `dimensionName` | `string` A dimension name in the request to order by. |\n| `orderType` | `enum (`[OrderType](/analytics/devguides/reporting/data/v1/rest/v1alpha/OrderBy#OrderType)`)` Controls the rule for dimension value ordering. |\n\nOrderType Rule to order the string dimension values by.\n\n| Enums ||\n|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `ORDER_TYPE_UNSPECIFIED` | Unspecified. |\n| `ALPHANUMERIC` | Alphanumeric sort by Unicode code point. For example, \"2\" \\\u003c \"A\" \\\u003c \"X\" \\\u003c \"b\" \\\u003c \"z\". |\n| `CASE_INSENSITIVE_ALPHANUMERIC` | Case insensitive alphanumeric sort by lower case Unicode code point. For example, \"2\" \\\u003c \"A\" \\\u003c \"b\" \\\u003c \"X\" \\\u003c \"z\". |\n| `NUMERIC` | Dimension values are converted to numbers before sorting. For example in NUMERIC sort, \"25\" \\\u003c \"100\", and in `ALPHANUMERIC` sort, \"100\" \\\u003c \"25\". Non-numeric dimension values all have equal ordering value below all numeric values. |\n\nPivotOrderBy Sorts by a pivot column group.\n\n| JSON representation ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"metricName\": string, \"pivotSelections\": [ { object (/analytics/devguides/reporting/data/v1/rest/v1alpha/OrderBy#PivotSelection) } ] } ``` |\n\n| Fields ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `metricName` | `string` In the response to order by, order rows by this column. Must be a metric name from the request. |\n| `pivotSelections[]` | `object (`[PivotSelection](/analytics/devguides/reporting/data/v1/rest/v1alpha/OrderBy#PivotSelection)`)` Used to select a dimension name and value pivot. If multiple pivot selections are given, the sort occurs on rows where all pivot selection dimension name and value pairs match the row's dimension name and value pair. |\n\nPivotSelection A pair of dimension names and values. Rows with this dimension pivot pair are ordered by the metric's value.\n\nFor example if pivots = ('browser', 'Chrome') and metricName = \"Sessions\", then the rows will be sorted based on Sessions in Chrome. \n\n ---------|----------|----------------|----------|----------------\n | Chrome | Chrome | Safari | Safari\n ---------|----------|----------------|----------|----------------\n Country | Sessions | Pages/Sessions | Sessions | Pages/Sessions\n ---------|----------|----------------|----------|----------------\n US | 2 | 2 | 3 | 1\n ---------|----------|----------------|----------|----------------\n Canada | 3 | 1 | 4 | 1\n ---------|----------|----------------|----------|----------------\n\n| JSON representation ||\n|---------------------------------------------------------------|---|\n| ``` { \"dimensionName\": string, \"dimensionValue\": string } ``` |\n\n| Fields ||\n|------------------|----------------------------------------------------------------|\n| `dimensionName` | `string` Must be a dimension name from the request. |\n| `dimensionValue` | `string` Order by only when the named dimension is this value. |"]]