【问题标题】:Grouping by a matrix depending on a value found via combination of three string columns in ssrs 2008根据通过组合 ssrs 2008 中的三个字符串列找到的值按矩阵分组
【发布时间】:2016-04-08 01:36:36
【问题描述】:

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

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

我想做的是在 ssrs 2008 中按此表进行分组,但不是这些列中的任何一个。我将需要添加一个名为“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 中提供它。任何帮助将不胜感激

【问题讨论】:

  • 这实际上是基于 TYPE 列的矩阵表,还是在常规表中有单独的 Type 列(1、2、3)?你的数据看起来像第一个例子吗(ID、type1、type2、type3、value)?
  • 它们是常规表中的类型列。当前的数据看起来像(id,type1,type2,type3),我想按我们需要分配为问题示例的总列对这个表进行排序。总列是临时的,没有人会看到它,它只用于按流程排序

标签: reporting-services ssrs-2008 ssrs-2008-r2


【解决方案1】:

您的 Total 列表达式应为:

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

IFF 检查参数 1 中的表达式,如果为 true(第二个参数)则返回 1,否则返回 0(第三个参数)。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-05
    • 2016-03-11
    • 1970-01-01
    • 1970-01-01
    • 2023-03-04
    • 1970-01-01
    相关资源
    最近更新 更多