Loop Functions

Read(429) Label: loop operation,

  esProc offers loop functions that perform loop operations.

Ø  A.(x)

Compute an expression with each member of a sequence, and return the results

Ø  A.avg()

Compute the average value of the non-null members in a sequence

Ø  A.avg(x)

Compute x with each member of the sequence and then compute the average value of the non-null members of the new sequence

Ø  A.calc()

Compute an expression with one or more specified records and return the results

Ø  A.conj()

Concatenate all the members in a sequence whose members are sequences

Ø  A.conj(x)

Compute x with each member of the sequence whose members are sequences, and then concatenate the computed results

Ø  A.contain()

Check whether a given data object is a member of a certain sequence

Ø  A.count()

Count the number of non-null members in a sequence

Ø  A.count(x)

Compute x with each member of the sequence and then count the number of non-null sequence members of the new sequence

Ø  A.diff()

Compute difference between members of a sequence which are also sequences

Ø  A.diff(x)

Compute x with each member of the sequence whose members are sequences, and then compute difference between members of the new sequence

Ø  A.f(x)

The common rules of loop functions

Ø  A.find(k)

Find a record according to its primary key value

Ø  A.ifn()

Get the first non-null member from a sequence

Ø  A.ifn(x)

Compute x with each member of the sequence and return the first non-null member of the new sequence

Ø  A.isect()

Compute the intersection of the member sequences of a sequence

Ø  A.isect(x)

Compute x with each member of the sequence whose members are sequences, and then compute intersection of members of the new sequence

Ø  A.iterate()

Perform interative loop on a record sequence and return the result of the last calculation of a given expression

Ø  A.max()

Compute the maximum value of all the non-null members in a sequence

Ø  A.max(x)

Compute x with each member of the sequence and then find the maximum value of the members of the new sequence

Ø  A.maxp()

Return the member that makes the maximum value for the expression

Ø  A.min()

Compute the minimum value of all the non-null members in a sequence

Ø  A.min(x)

Compute x with each member of the sequence and then find the minimum value of the members of the new sequence

Ø  A.minp()

Return the member that makes the minimum value of the expression

Ø  A.nvl()

Get the first non-null member that isn’t double quoted from an integer sequence

Ø  A.pfind()

Find the sequence number of a record by its primary key

Ø  A.pmax()

Return the sequence numbers of members with the maximum value in a sequence

Ø  A.pmin()

Return the sequence numbers of members with the minimum value in a sequence

Ø  A.pos()

Get the position of a member in a sequence

Ø  A.pos(x)

Get the positions of sequence members in another sequence

Ø  A.pseg(x,y)

Return the sequence number of the interval in which the parameter falls

Ø  A.pselect()

Return the sequence numbers of members that satisfy the query criterion

Ø  A.psort()

Return the sequence numbers of the sorted members in the original sequence

Ø  A.ptop()

Get sequence numbers of top n smallest members of the sequence

Ø  A.rank(y)

Compute the ranking of a specified value in a sequence

Ø  A.rank(y,x)

Get the ranking of a specified value in a computed sequence

Ø  A.ranks()

Compute the ranking of each member in a sequence

Ø  A.ranks(x)

Get the rankings of members of sequence A.(x)

Ø  A.run(x1,x2,xi)

Compute one or more expressions with each member in a sequence and return the modified sequence

Ø  A.select()

Return members that make the value of the expression true

Ø  A.sort()

Generate a new sequence by sorting the members of a sequence

Ø  A.sum()

Compute the sum of members of a sequence

Ø  A.sum(x)

Compute x with each member of the sequence and compute the sum of the members of the new sequence

Ø  A.top()

Get the n smallest members from a sequence

Ø  A.union()

Compute the union of members in a sequence whose members are sequences

Ø  A.union(x)

Compute x with each member of the sequence whose members are sequences, and then compute union of members of the new sequence

Ø  A.xunion()

Generate a new sequence by uniting and rearranging distinct members in each of a sequence’s sub-sequences

Ø  A.xunion(x)

Calculate an expression with each member of every sub-sequence of a sequence to generate a new sequence by uniting and rearranging distinct members in each of the resulting sub-sequences

Ø  cum()

An iterative loop to get a cumulative value over records in which one of its fields has same values

Ø  iterate()

An iterative loop for calculating an expression

Ø  k.row()

Ø  n.f(x) 

Find one or more records according to specified key value(s)

Perform a loop operation by declaring an integer loop variable

Ø  r.(x)

Compute an expression with a record and return the result

Ø  r.run()

Compute an expression based on a record and return the modified record

Ø  rank()

An iterative loop for numbering records according to the values of certain fields

Ø  ranki()

An iterative loop for numbering records according to the values of certain fields

Ø  seq()

An iterative loop for numbering records in which a certain field contains same values

Ø  ~,#,F,A[i]...

Introduce the common rules of expressions in a loop function