我有一个包含大量记录的数据集。
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'的情况。 所以约翰和皮特被展示为jan - feb - mar和汉克的线显示差距.... 如果我把Hank放在11岁的feb和Pete为0,那么约翰和汉克的阵容中没有任何差距。 因此,如果末尾有“0”,则该行继续应该,只要中间有一个0,就会有0的行中有间隙。 之后的任何员工(Mike,Blake,Michelle等)都会在线路接触零的地方出现间隙。 我玩弄了空点,它确实填补了空白(例如用红线),但为什么John和Pete显示为一直到最后的法线,填满0,而其他人有红线(空点) )?
严格说来,没有空/ null,它们是'0'。或者我错了?
为什么我不能让图表显示与Tablix相同的图表?
答案 0 :(得分:1)
不确定您的报告发生了什么,但您的数据没有任何问题或将其显示在图表中。
数据(稍加修改以更好地与您的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 。
看起来像:
所有名称都显示所有月份的积分。我知道这对您的具体问题没有帮助,但它确实表明它可以按预期工作。在你的情况下,我将完全创建一个新的图表,添加上面的基本字段,看看它的外观;一旦这样,您可以添加更多格式等,检查它是否仍然适用于每一步。
答案 1 :(得分:0)
我不知道发生了什么。不知何故,图表得出结论,在数据集返回值“0”的情况下,值为NOTHING。 所以我通过使用聚合的表达式而不是使用默认的总和来解决它:
IIF(isnothing(字段!sales.Value),0,SUM(字段!sales.Value))