Dense Rank Explanation 详解
Detailed Explanation for Dense Rank Explanation
我正在尝试理解使用多个参数时的密集秩函数。有人可以帮助我理解以下示例或任何其他示例吗?
提前致谢!
计算列:DenseRank([国家],[事件标识符])
DenseRank(Arg1, Arg2, Arg3...)
Returns an integer value ranking of the values in the selected column.
The first argument is the column to be ranked. An optional argument is
a string determining whether to use an ascending (default) or a
descending ranking. For the highest value to retrieve rank 1, use the
argument "desc", for the lowest value to retrieve rank 1, use "asc".
Ties are given the same rank value and the highest ranking number
equals the number of unique values in the column.
Additional column arguments (optional) can be used when the column
should be split into separately ranked categories.
Examples:
DenseRank([Sales])
DenseRank([Sales], "desc", [Region])
因此,在您的示例中,您使用默认的 "asc"
顺序对按 Even Identifier
分组/分区的 Country
进行排名。这是按字母顺序完成的,因此,如果我们查看 Interim 1,我们将看到 4 个排名,1-4,因为 Interim 1 有 4 个国家/地区,按字母顺序(升序)。每个 "group",即第三个参数,在您的情况下 Event Identifier
,将获得一组从 1 - n 的排名,其中 n 是不同值的数量。如果去掉这个参数,整个数据集的排名将不考虑Event Identifier
我正在尝试理解使用多个参数时的密集秩函数。有人可以帮助我理解以下示例或任何其他示例吗?
提前致谢!
计算列:DenseRank([国家],[事件标识符])
DenseRank(Arg1, Arg2, Arg3...)
Returns an integer value ranking of the values in the selected column. The first argument is the column to be ranked. An optional argument is a string determining whether to use an ascending (default) or a descending ranking. For the highest value to retrieve rank 1, use the argument "desc", for the lowest value to retrieve rank 1, use "asc".
Ties are given the same rank value and the highest ranking number equals the number of unique values in the column.
Additional column arguments (optional) can be used when the column should be split into separately ranked categories.
Examples:
DenseRank([Sales])
DenseRank([Sales], "desc", [Region])
因此,在您的示例中,您使用默认的 "asc"
顺序对按 Even Identifier
分组/分区的 Country
进行排名。这是按字母顺序完成的,因此,如果我们查看 Interim 1,我们将看到 4 个排名,1-4,因为 Interim 1 有 4 个国家/地区,按字母顺序(升序)。每个 "group",即第三个参数,在您的情况下 Event Identifier
,将获得一组从 1 - n 的排名,其中 n 是不同值的数量。如果去掉这个参数,整个数据集的排名将不考虑Event Identifier