@firstsby |

First non-missing value in a series or alpha for each group defined by distinct values.

Syntax: @firstsby(x, y[y1, y2, ... yn, s])

x: series, alpha

y1...yn series, alpha, group

s: (optional) sample string or object

Return: number, string

First non-missing value in each distinct value group computed using the current workfile or specified sample.

Examples

show @firstsby(x, g1, g2)

produces a linked series of the by-group first non-missing values of the series x, where members of the same group have identical values for both g1 and g2.

Cross-references

See also
@lastsby.