bin

Returns one of two strings based on whether a value exceeds a threshold or not.

Example

Mark the employees with employee number below 4 with the “low” string and those with employee number 4 or above with the “high” string.

bin(INCORTA.ADMIN_EMP.EMPNO, "low", 4, "high")

Syntax

bin(series, label_a, limit, label_b)

Parameters

  • series: series or column of int values to be divided into two groups
  • label_a: string label to apply to series values less than limit
  • limit: int value marking the division between the two bins
  • label_b: string label to apply to series values greater than or equal to limit

Returns

string

Description

bin sorts a series of integers and labels them in one of two ways based on a threshold value. Parameter limit is the threshold value. For values of series that are less than limit, label_a is returned. For values of series greater than or equal to limit label_b is returned.

© Incorta, Inc. All Rights Reserved.