{"id":7316,"date":"2014-06-07T02:24:39","date_gmt":"2014-06-07T02:24:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/07\/how-to-sort-a-reporting-services-table-by-an-auto-generated-column-collection-of-common-programming-errors\/"},"modified":"2014-06-07T02:24:39","modified_gmt":"2014-06-07T02:24:39","slug":"how-to-sort-a-reporting-services-table-by-an-auto-generated-column-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/07\/how-to-sort-a-reporting-services-table-by-an-auto-generated-column-collection-of-common-programming-errors\/","title":{"rendered":"How to sort a Reporting Services table by an auto generated column-Collection of common programming errors"},"content":{"rendered":"<p>You can sort by any sort of expression &#8211; SSRS will quite happily sort something like two fields concatenated together:<\/p>\n<pre><code>=Fields!Class1.Value &amp; Fields!value.Value\n<\/code><\/pre>\n<p>Just be careful to make sure the sorting is applied at the appropriate level to avoid unexpected, i.e. make sure you don&#8217;t have different sorting expressions in any row group or detail group if not required.<\/p>\n<p>If <strong>No Vencido<\/strong> is the grouping expression, apply the sorting at the group level.<\/p>\n<p>If you don&#8217;t want to sort on an expression, you can create a calculated field for each row in the dataset with the expression <code>=Fields!Class1.Value &amp; Fields!value.Value<\/code> and group\/sort on that calculated field as required.<\/p>\n<p><strong>Edit after comment<\/strong><\/p>\n<p>OK, I think you need to apply a sort expression like this to the groups that apply to the <code>Top<\/code> and <code>Otros<\/code> rows:<\/p>\n<pre><code>=Sum(IIf(Fields!Clase_1.Value = \"No Vencido\", Fields!Monto.Value, Nothing))\n<\/code><\/pre>\n<p>This is still sorting by the total <code>Monto<\/code> for each row group, but only considering the rows where <code>Clase_1<\/code> is <strong>No Vencido<\/strong>.<\/p>\n<p>Once this is set up sort by <strong>A-Z<\/strong> or <strong>Z-A<\/strong> as required.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can sort by any sort of expression &#8211; SSRS will quite happily sort something like two fields concatenated together: =Fields!Class1.Value &amp; Fields!value.Value Just be careful to make sure the sorting is applied at the appropriate level to avoid unexpected, i.e. make sure you don&#8217;t have different sorting expressions in any row group or detail [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7316","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7316"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7316\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}