proportion()

Read(621) Label: proportion,

Here is how to use proportion() function.

A.proportion()

Description:

Compute the proportion of each member of a sequence.

Syntax:

A.proportion()

Note:

The function computes the proportion of each member of sequence A.

Parameter:

A

A sequence

Return value:

Sequence

Example:

 

A

 

1

=[1,2,3,4]

 

2

=A1.proportion()

Return0.1,0.2,0.3,0.4.

3

=connect("demo").query("select  *  from SALES")

 

4

=A3.group(SELLERID;sum(AMOUNT):TolAmount)

Calculate total sale of each salesperson in table sequence A3.

5

=A4.(TolAmount).proportion()

Calculate the proportion of each value of sequence A4’s TolAmount column.