首页 > 解决方案 > 在画面中使用 LOD 计算排名

问题描述

我有一张看起来像这样的桌子

column1 column2 value
a        d        10
a        e        20
b        d        30
b        e         40

and I want to get the rank of the value without considering column1 so I use and LOD to first get the total value with:  {EXCLUDE [column1]: SUM([value])}

this works and produces

  rank
d  40
e  60
d  40
e  60

BUT what I want to do is get the rank. So I'd like 

  rank
d  2
e  1
d  2
e  1

when I do this  RANK( {EXCLUDE [Pct Of Adv Buckets]: SUM([Notional])} )

I get an error "all fields must be aggregate or constants when using table calcualtions. Can you advise how to get teh rank.

标签: tableau-api

解决方案


你试过 RANK(SUM({EXCLUDE [Column1]: SUM([Value])})) 我有不同的耙,但我认为那是你正在寻找的。


推荐阅读