从qlik中的总计数/总和中排除一维

Exclude one dimension from total count / sum in qlik

我想在 Qlik 中获得一个值的百分比份额。我有两个维度和我在分布图中使用的 KPI:

数据为:

Point   Brand   Business
A        AA      1
B        AA      1
C        AA      1

现在我正在使用公式:Count([Business])/Count(total [Business]),在我的 Y-Achse 上我有 Brand,我的观点是 Point,现在他正在计算超级总数,但我怎样才能只计算品牌的总数?类似于 Count([Business])/Count(total [Business], if Brand == Brand)

您应该将 Brand 字段添加为 aggregation scope

count([Business]) / Count(total <Brand> [Business])

来自 Qlik 的 documentation

By using TOTAL [], where the TOTAL qualifier is followed by a list of one or more field names as a subset of the chart dimension variables, you create a subset of the total possible values.

将字段添加到总数中可以翻译为:count 所有 Business 但按 Brand 聚合。由于 Brand 也是图表的一个维度,因此对于每一行,Count Total 将是当前 Brand

的计数