简体   繁体   English

SSRS-按堆积条形图中的值对系列进行排序

[英]SSRS - Sorting Series by value In a Stacked Bar chart

I have a dataset that I'm representing as a stacked bar chart. 我有一个数据集,我将其表示为堆积的条形图。 I want to order each series by it's value (See image) 我想按值排序每个系列(参见图片)

在此处输入图片说明

The ordering works as expected in the first column, however proceeding columns maintain the order of the last, regardless of their value. 排序工作在第一列中按预期进行,但是后续列将保留最后一列的顺序,无论其值如何。

Is this possible in SSRS? SSRS有可能吗? Im current sorting the series by value. 我目前按值对系列进行排序。

I don't have enough reputation to give a comment so posting this as an answer. 我的信誉不足,无法发表评论,因此请将其发布为答案。

By looking at your graph I can presume that maybe your value is not an integer or you haven't put the right field for sorting the series. 通过查看您的图表,我可以假定您的值不是整数,或者您没有为序列排序输入正确的字段。

In series properties go to the sorting and sort by the value instead of the name of the stacked bar as below the screenshot. 在系列属性中,进行排序,并按值而不是如屏幕快照下方的堆叠条的名称进行排序。 在此处输入图片说明

If this too is not resolving your problem then you have to look ur closely and decide what u want to put in group and what u want to put in ur sorting. 如果这也不能解决您的问题,则您必须仔细检查并决定要分组的内容以及要分类的内容。

Thanks for your responses. 感谢您的回复。 I fixed the issue by utilising the following SQL to seperate each category group to have its own order. 我使用以下SQL来分隔每个类别组以具有其自己的顺序,从而解决了该问题。

SELECT Row_number() 
     OVER ( 
       partition BY createddate 
       ORDER BY Count(loggedrecid)) AS Col_group, 
   Count(loggedrecid), 
   createddate, 
   ownerteam 
FROM   @allrequests 
WHERE  faculty IN ( @faculty ) 
GROUP  BY createddate, 
      ownerteam 
ORDER  BY createddate ASC 

在此处输入图片说明

I then added Col_group as the Series group and ordered it by Col_group 然后,我将Col_group添加为系列组,并按Col_group对其进行排序

在此处输入图片说明

All working as expected! 一切都按预期工作! Thanks for the assistance. 感谢您的协助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM