Tableau以行为基础计算百分比

时间:2019-03-23 15:30:02

标签: tableau

我已经计算了所有L1到L5,A到E的中位数。对于每个L(1到5),我想使用C的中位数作为100%的基数,然后看看其他A,C ,D,E对阵。我该怎么做? enter image description here

1 个答案:

答案 0 :(得分:0)

Look at this picture to see my values

Look this picture to see how to set C depends upon Job Grade as a base, use the following computed field Basis C (Job Grade)

创建一个计算字段Basis C (Job Grade)

{ FIXED [Job Grade]:
                    Max(
                        IF [Performance Grade]="C" 
                        THEN [Median Per grade/performance] 
                        ELSE 0 
                        END
                    )
}

固定的详细程度表达式使用指定的尺寸[性能等级]计算基数C,而无需引用视图中的尺寸。

然后很容易计算C as the base of 100%

[Median Per grade/performance]/[Basis C (Job Grade)]

Look at this picture to see how it works

或者您需要为所有计算Base C

{ FIXED :
        Max(
            IF [Performance Grade]="C" 
            THEN [Median Per grade/performance] 
            ELSE 0 
            END
        )
}

固定级别的详细信息表达式将计算基数C,而无需引用视图中的尺寸。

然后很容易计算C as the base of 100%

[Median Per grade/performance]/[Basis C]

Look this picture to see how to set C as a base, use the following computed field `Basis C

Look at my tableau solution for more information