Median - 指令碼函數
Median() 會根據 group by 子句所定義的若干記錄,來傳回運算式中值的彙總中位數。
Syntax:
Median (expr)
Return data type: 數值
Arguments:
引數 | 描述 |
---|---|
expr | 包含待測量之資料的運算式或欄位。 |
Examples and results:
將範例指令碼新增至您的應用程式並予以執行。然後使用 Type 和 MyMedian 作為維度建立一個連續表。
範例 | 結果 |
---|---|
Table1: crosstable LOAD recno() as ID, * inline [ Observation|Comparison 35|2 40|27 12|38 15|31 21|1 14|19 46|1 10|34 28|3 48|1 16|2 30|3 32|2 48|1 31|2 22|1 12|3 39|29 19|37 25|2 ] (delimiter is '|'); Median1: LOAD Type, Median(Value) as MyMedian Resident Table1 Group By Type;
|
Median() 的計算結果如下:
|