HOW TO: Find the Three Largest Values in a Column

HOW TO: Find the Three Largest Values in a Column

1. Use the Derive transform and the kthlargest function to create a new column containing the third largest value in the source column:
derive value: kthlargest(totalRevenue, 3)

The following image shows this transform applied to an example dataset that contains total revenue figures for individual salespeople:



2. Use the Keep transform to filter the dataset so that the dataset only contains rows where the value from the source column is greater than or equal to the third largest value from the source column:
keep row: totalRevenue >= kthlargest_totalRevenue

The following image shows the three rows that Trifacta will keep in the example dataset based on this condition:



3. Use the Sort transform to order the values in descending order:
sort order: -totalRevenue

The following image shows a preview of the example dataset after applying this transformation: