Median of a Measure by Breaking Attribute: MEDIAN
Note: MEDIAN is not supported for use in the input statement of a scripted data source (ETL).
MEDIAN supports breaking attributes that instruct the query engine to re-calculate the median based on values changing for a particular attribute.
MEDIAN([measure] BY [attribute])
For example:
SELECT [Products.Categories], MEDIAN([Order_Date: Sum: Revenue] BY [Products.Categories]) FROM [ALL]
| Categories | MEDIAN([Order_Date: Sum: Revenue], BY) |
|---|---|
| Desktops | 150,413,715 |
| Mobile Phones | 101,721,700 |
| MP3 Players | 27,047,423 |
| Notebooks | 180,664,684 |
| Tablets | 204,825,336 |