Opposite Number

Read(2209) Label: variable name, datetime, string,

Description:

Opposite number.

Syntax:

-a

Note:

Opposite number. If a is the datetime value or a string, then it can be used to sort in descending order.The operator is usually used with functions that can only sort data in ascending order, including cs.sortx(), A.sort(x ;loc), A.psort (x), A.top(n,x), and etc. By default, they sort data in ascending order,but the sign “-“ can be used to sort the inverse fields. And sorting the inverse fields ascendingly means sorting the original fields descendingly.

Parameter:

a

Variable name , datetime or string

Return value:

Number or sequence

Example:

 

A

 

1

=a=7

 

2

=-a

-7

3

=demo.query("select * from EMPLOYEE")

 

4

=A3.sort(-BIRTHDAY)

Sort data by BIRTHDAY descendingly.

5

=A3.sort(-DEPT)

Sort data by a string descendingly.