Locate by serial numbers

  • The Being Ordered refers to the data is stored in a certain order. Every piece of data and every member have their absolute or relative numbers. You can access the data with these serial numbers and operate on the data conveniently, such as locating, ranking, or sorting.
  • With serial numbers, you can access to the member of sets more easily.
  • Get the sales value field of the last record: sales.m(-1).(amount)
  • Get records whose sales value are over 1000: sales.pselect@a(amount>1000)
  • Get the record with the highest sales amount: sales.pmax@a(amount)
A
1 =tdb.query(“select * from Employee”)
2
=A1.sort(EntryDate)
Sort by EntryDate
3
=A2.pmin(Birthday)
The position of the eldest employee in above sequence
4 =A2(to(A3-1)) The employees on-boarding earlier than that of the eledest employee
5 =tdb.query(“select * from StockPrice where StockID=’000062′”)
6
=A5.sort(TradeDate)
Sort by TradeDate
7
=A6.pmax(ClosingPrice)
The position of the date record with the highest stock price in the set
8
=A6.calc(A7,ClosingPrice/ClosingPrice[-1]-1)
Increase of the highest stock price compared with price of the previous trading day