--- id: median title: median Grouping Operator sidebar_label: median slug: /help/docs/search/search-query-language/group-aggregate-operators/median/ canonical: https://www.sumologic.com/help/docs/search/search-query-language/group-aggregate-operators/median/ --- import useBaseUrl from '@docusaurus/useBaseUrl'; In order to calculate the median value for a particular field, you can utilize the [`pct` (percentile) operator](/docs/search/search-query-language/group-aggregate-operators/pct-percentile) with a percentile argument of 50. ## Syntax `pct( [, 50]) [as ] [by ]` ## Rules * Creates a field with the naming convention: `__pct_50` ## Examples For example: ```sumo * | parse "data=*" as data | pct(data, 50) as median ``` To calculate the median value of a field called `"Len: *"` as seconds, and then take the median, use the following query: ```sumo | parse "Len: *" as seconds | pct(seconds,50) as median ``` Which would return results similar to: Median