series_subtract()series_subtract()

计算两个数值序列输入的元素对应减法。Calculates the element-wise subtraction of two numeric series inputs.

语法Syntax

series_subtract(series1, series2)series_subtract(series1, series2)

参数Arguments

  • series1、series2:输入数值数组,从第一个数组按元素减去第二个数组得到一个动态数组结果。series1, series2: Input numeric arrays, the second to be element-wise subtracted from the first into a dynamic array result. 所有参数都必须是动态数组。All arguments must be dynamic arrays.

返回Returns

在两个输入之间进行按元素减法运算计算出的动态数组。Dynamic array of calculated element-wise subtract operation between the two inputs. 任何非数值元素或非现有元素(不同大小的数组)都会生成 null 元素值。Any non-numeric element or non-existing element (arrays of different sizes) yields a null element value.

示例Example

range x from 1 to 3 step 1
| extend y = x * 2
| extend z = y * 2
| project s1 = pack_array(x,y,z), s2 = pack_array(z, y, x)
| extend s1_subtract_s2 = series_subtract(s1, s2)
s1s1 s2s2 s1_subtract_s2s1_subtract_s2
[1,2,4][1,2,4] [4,2,1][4,2,1] [-3,0,3][-3,0,3]
[2,4,8][2,4,8] [8,4,2][8,4,2] [-6,0,6][-6,0,6]
[3,6,12][3,6,12] [12,6,3][12,6,3] [-9,0,9][-9,0,9]