...
Excerpt 

Extracts the ranked unique value from the values in a column, where where k=1 returns returns the maximum value, when a specified condition is met. The value for for k must must be between 1 and 1000, inclusive. Inputs can be Integer or Decimal. 
KTHLARGESTUNIQUEIF
calculations are filtered by a conditional applied to the group.
For purposes of this calculation, two instances of the same value are treated as the same value of of k
. So, if your dataset contains four rows with column values values 10
, 9
, 9
, and and 8
, then KTHLARGEST
returns 9
for the the function returns 9
for k=2
and and 8
for for k=3
.
 For a nonunique version of this function, see KTHLARGEST Function.
When used in a pivot
transform, the function is computed for each instance of the value specified in the group
parameter. See Pivot Transform.
Input column can be of Integer or Decimal type. Nonnumeric data in the column is Other values column are ignored. If a row contains a missing or null value, it is not factored into the calculation.
Info 

NOTE: When added to a transformation, this function is applied to the current sample. If you change your sample or run the job, the computed values for this function are updated. Transformations that change the number of rows in subsequent recipe steps do not affect the values computed for this step. 
To perform a simple kth largest unique calculation without conditionals, use the KTHLARGESTUNIQUE
function. See KTHLARGESTUNIQUE Function.
D code 

pivot value:KTHLARGESTUNIQUE(myRating, 3kthlargestuniqueif(POS_Sales, 2, DayOfWeek == 'Saturday') group:postal_code limit:1 
Output:
...
Returns the secondmost value (rank=2) from the POS_Sales
column when the DayOfWeek
value is Saturday
.
D code 

pivot value:KTHLARGESTUNIQUEkthlargestuniqueif(function_col_ref, limit, ktest_integerexpression) [group:group_col_ref] [limit:limit_count] 
Argument  Required?  Data Type  Description 

function_Name of column to which to apply the functionReference to the column you wish to evaluate. 
k_integer  Y  integer 
(positive) unique value to extract from the source column 
test_expression  Y  string  Expression that is evaluated. Must resolve to true or false 
For more information on the the group
and and limit
parameters parameter, see see Pivot Transform.dslangnotes
...
col_ref
Name of the column the whose values of which you want wish to calculate use in the meancalculation. Column Inputs must contain be Integer or Decimal valuesDecimal values.
 Literal values are not supported as inputs.
 Multiple columns and wildcards are not supported.
Required?  Data Type  Example Value 

Yes  String 
(column reference)that corresponds to the name of the column  myValues 
k_integer
Integer representing the unique ranking of the unique value to extract from the source column. Duplicate values are treated as a single value for purposes of this function's calculation.
Info 

NOTE: The value for k must be an integer between 1 and 1,000 inclusive. 
k=1
represents represents the maximum value in the column.  If k is greater than or equal to the number of values in the column, the minimum value is returned.
 Missing and null values are not factored into the ranking of of
k
.
test_expression
This parameter contains the expression to evaluate. This expression must resolve to a Boolean (true
or false
) value.
Required?  Data Type  Example Value 

Yes 
Integer (positive)4
String expression that evaluates to true or false  (LastName == 'Mouse' && FirstName == 'Mickey') 
Example  Secondmost measurements for a specific city
KTHLARGEST KTHLARGESTIF Function   EXAMPLE  


KTHLARGEST