G-Green A-Amber R-Red
如果该值小于8,则应该是8到9之间的红色,应该是琥珀色,高于9则是绿色。
另外我需要对结果进行分组,例如:如果结果为GAR(绿色,琥珀色和红色),我需要一个值为“Not Good”,如果值为RAG(红色琥珀色和绿色),则应该是“好”如果全是红色就是“穷人”
如何将红色,琥珀色和绿色分组?
+---------+---------+------+--------+-------+
| PROJECT | SUBTASK | TASK | PERIOD | VALUE |
+---------+---------+------+--------+-------+
| A | AA | AAA | 1 | 6 |
| A | AA | AAA | 2 | 8.2|
| A | AA | AAA | 3 | 10 |
| B | BB | BBB | 1 | 10 |
| B | BB | BBB | 2 | 9 |
| B | BB | BBB | 3 | 6 |
| C | CC | CCC | 1 | 7 |
| C | CC | CCC | 2 | 7 |
| C | CC | CCC | 3 | 6 |
+---------+---------+------+--------+-------+
输出
+---------+---------+------+---+---+---+
| PROJECT | SUBTASK | TASK | 1 | 2 | 3 |
+---------+---------+------+---+---+---+
| A | AA | AAA | R | A | G |
| B | BB | BBB | G | G | R |
| C | CC | CCC | R | R | R |
+---------+---------+------+---+---+---+
最终输出
+---------+---------+------+----------+
| PROJECT | SUBTASK | TASK | Result |
+---------+---------+------+----------+
| A | AA | AAA | Good |
| B | BB | BBB | Not Good |
| C | CC | CCC | Poor |
+---------+---------+------+----------+
答案 0 :(得分:0)
根据编辑的样本数据,规则应该是> = 9对比> 9.考虑到这一点,这里是步骤
插入计算列并将其命名为CREATE DATABASE
[CalcCol]
插入计算列并将其命名为case
when [VALUE]<8 then "R"
when ([VALUE]>=8) and ([VALUE]<9) then "A"
when [VALUE]>=9 then "G"
end
[Concat]
插入计算列并将其命名为Substitute(Substitute(Concatenate([CalcCol]) over (Intersect([PROJECT],[SUBTASK],[TASK])),",","")," ","")
[FinalOutput]
现在,您将在常规表视图中或在交叉表视图中看到结果,其中case
when [Concat]="RAG" then "Good"
when [Concat]="GGR" then "Not Good"
when [Concat]="RRR" then "Poor"
end
为单元格值,垂直轴按此顺序设置为项目,子任务,任务。