0

我有一个包含大量记录的数据集。

Employee (varchar) | month (int) | Sales (money)
John | jan | 15
John | jan | 6
Hank | jan | 20
Mike | jan | 0
Hank | jan | 12
Pete | jan | 0
Pete | jan | 7
John | feb | 4
John | feb | 9
Hank | feb | 0
Pete | feb | 11
Mike | feb | 15
John | mar | 0
Hank | mar | 20
Mike | feb | 0
Pete | mar | 10
Pete | mar | 12

每个名称每个月都存在并且有一个值(尽管为 0)

我有一个 tablix 对它进行分组,它正确显示:

     | jan | feb | mar
John |  21 |  13 |  0 
Hank |  32 |   0 | 20
Pete |   7 |  11 |  0
Mike |   0 |  15 |  0

(其实还有一个 Mike、Edward、Michelle、Blake 等等)

然而,基于 dame 数据集的折线图省略了所有值“0”。线断了,有缝隙。除了序列中没有“0”的前两个。因此,John 和 Pete 显示为 jan - feb - mar 并且 Hank 的线条显示间隙......如果我在 2 月将 Hank 设置为 11,将 Pete 设置为 2 月的 0,那么显示的 John 和 Hank 的线条中没有间隙。因此,如果末尾有“0”,则该行继续按原样继续,只要中间有一个 0,行中就有 0 的间隙。之后的任何员工(迈克、布莱克、米歇尔等)在线路应该接触到零的地方都有差距。我玩弄了空点,它确实填补了空白(例如用红线),但为什么约翰和皮特显示为一条一直到最后的正常线,用 0' 填充

严格来说,没有空/空值,它们是“0”。还是我弄错了?

为什么我不能让图表简单地显示与 tablix 相同的内容?

4

2 回答 2

2

不确定您的报告发生了什么,但您的数据或将其显示在图表中没有任何问题。

数据(稍作修改以更好地与您的 Tablix 保持一致):

select employee = 'John' ,month = 1, monthName = 'Jan' ,sales =  15
union all select employee = 'John' ,month = 1, monthName = 'Jan' ,sales =  6
union all select employee = 'Hank' ,month = 1, monthName = 'Jan' ,sales =  20
union all select employee = 'Mike' ,month = 1, monthName = 'Jan' ,sales =  0
union all select employee = 'Hank' ,month = 1, monthName = 'Jan' ,sales =  12
union all select employee = 'Pete' ,month = 1, monthName = 'Jan' ,sales =  0
union all select employee = 'Pete' ,month = 1, monthName = 'Jan' ,sales =  7
union all select employee = 'John' ,month = 2, monthName = 'Feb' ,sales =  4
union all select employee = 'John' ,month = 2, monthName = 'Feb' ,sales =  9
union all select employee = 'Hank' ,month = 2, monthName = 'Feb' ,sales =  0
union all select employee = 'Pete' ,month = 2, monthName = 'Feb' ,sales =  11
union all select employee = 'Mike' ,month = 2, monthName = 'Feb' ,sales =  15
union all select employee = 'John' ,month = 3, monthName = 'Mar' ,sales =  0
union all select employee = 'Hank' ,month = 3, monthName = 'Mar' ,sales =  20
union all select employee = 'Mike' ,month = 3, monthName = 'Mar' ,sales =  0
union all select employee = 'Pete' ,month = 3, monthName = 'Mar' ,sales =  10
union all select employee = 'Pete' ,month = 3, monthName = 'Mar' ,sales =  12

一个基本图表,只是通过向各个区域添加字段来创建:

在此处输入图像描述

唯一的其他操作是将标签更改为monthName

看起来像:

在此处输入图像描述

所有名称都显示所有月份的积分。我知道这对您的具体问题没有帮助,但它确实表明它可以按预期工作。在您的情况下,我将完全创建一个新图表,添加上面的基本字段并查看它的外观;一旦完成,您可以添加更多格式等,检查它在每个步骤中是否仍然有效。

于 2013-05-10T22:02:53.007 回答
0

我不知道发生了什么。不知何故,该图得出结论,在数据集返回值“0”的情况下,该值是 NOTHING。所以我通过使用聚合表达式而不是使用默认总和来解决它:

IIF(isnothing(Fields!sales.Value),0,Sum(Fields!sales.Value))

于 2013-05-15T12:39:18.987 回答