根据通过 ssrs 2008 中的三个字符串列的组合找到的值按矩阵分组

Grouping by a matrix depending on a value found via combination of three string columns in ssrs 2008

我在 ssrs 2008 中有一个矩阵,例如:

Id type1    type2    type3
1  low     normal    normal
2  high     low      normal
3  normal  normal    normal

我想做的是在 ssrs 2008 中按此 table 分组,但不是这些列中的任何一个。我将需要添加一个名为 "Total" 的额外隐藏列。本专栏的规则将是(我不知道怎么写,也不知道在ssrs中的什么地方):

int total = 0;
if(type1<>normal) total++;
if(type2<>normal) total++;
if(type3<>normal) total++;
return total;

并且group by需要以这一列为准。下面是一个例子:

Id type1    type2    type3   total(visibility:false)
2  high     low      normal   2
1  low     normal    normal   1
3  normal  normal    normal   0

如何在 ssrs 2008 中提供它。任何帮助将不胜感激

您的 Total 列表达式应为:

=IIF(type1 <> "normal", 1, 0) + IIF(type2 <> "normal", 1, 0) + IIF(type3 <> "normal", 1, 0)

IFF 检查参数 1 和 returns 中的表达式 1 if true(第二个参数)else 0(第三个参数)。

我认为您还想将其用作 SORTING 表达式(以相反的 [Z-A] 顺序)。