数据透视表计算函数 - Amazon QuickSight

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

数据透视表计算函数

您可以在数据透视表计算中使用以下函数。

您可以将列出的函数应用于以下数据:

Data table showing billed amounts by region, year, and consumption channel for HR and Billing services.
Data table showing billed amounts by region, year, and consumption channel for HR and Billing services.

Running total

Running total 函数计算给定单元格值与其之前的所有单元格值的总和。此总和的计算方法为 Cell1=Cell1, Cell2=Cell1+Cell2, Cell3=Cell1+Cell2+Cell3,依此类推。

计算方式选择表横向,沿表行应用 Running total 函数会得到以下结果。

Table showing billed amounts by customer region, date, and consumption channel for different service lines.

Difference

Difference 函数计算单元格值与其之前单元格值的差值。此差值的计算方法为 Cell1=Cell1-null, Cell2=Cell2-Cell1, Cell3=Cell3-Cell2,,依此类推。由于 Cell1-null = null,Cell1 值始终为空。

计算方式选择表横向,沿表行应用 Difference 函数得到以下结果。

Table showing billed amounts for regions, years, and channels across Billing and HR service lines.

Percentage difference

Percentage Difference 函数计算单元格值与其之前单元格值的百分比差值,然后除以其之前单元格的值。此值的计算方法为 Cell1=(Cell1-null)/null, Cell2=(Cell2-Cell1)/Cell1, Cell3=(Cell3-Cell2)/Cell2,,依此类推。由于 (Cell1-null)/null = null,Cell1 值始终为空。

计算方式选择表横向,沿表行应用 Percentage Difference 函数得到以下结果。

Table showing percentage differences in billed amounts across regions, years, and channels.

Percent of total

Percent of Total 函数计算给定单元格占计算中包含的所有单元格总和的百分比。此百分比的计算方法为 Cell1=Cell1/(sum of all cells), Cell2=Cell2/(sum of all cells),,依此类推。

计算方式选择表横向,沿表行应用 Percent of Total 函数得到以下结果。

Table showing percentage breakdown of billed amounts across regions, channels, and service lines.

Rank

Rank 函数计算单元格值与计算中包含的其他单元格值相比较的排名。Rank 始终将最高值显示为 1,最低值等于计算中包含的单元格数。如果两个或更多单元格具有相等的值,则它们排名相同,但在排名中各占一位。因此,下一个最高值的排名将下降该值所占的单元格数减 1。例如,如果对 5,3,3,4,3,2 排名,它们的排名将是 1,3,3,2,3,6。

例如,假设您具有以下数据。

Table showing billed amounts by customer region and service line for Marketing, HR, and Billing.

计算方式选择表横向,沿表行应用 Rank 函数得到以下结果。

Table showing sum of billed amount by customer region and service line for APAC, EMEA, and US.

Percentile

Percentile 函数计算的是计算中包含的等于或低于给定单元格值的单元格值百分比。

此百分比的计算方式如下:

percentile rank(x) = 100 * B / N Where: B = number of scores below x N = number of scores

计算方式选择表横向,沿表行应用 Percentile 函数得到以下结果。

Table showing billed amounts by region, date, and channel for Billing and HR service lines.