<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Crystal Reports - Conditional record sorting in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/crystal-reports-conditional-record-sorting/qaa-p/12128686#M4532108</link>
    <description>&lt;P&gt;Ok here's what you need to do:&lt;/P&gt;&lt;P&gt;1. Insert a Group on the Machine field&lt;/P&gt;&lt;P&gt;2. Create a formula called  @sort with this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT {Fault_field} //replace this with the database field or formula field that displays Fault strings
CASE 'severe' : 1
CASE 'significant' : 2
CASE 'insignificant' : 3
DEFAULT: 4&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;3. Go to the Insert Summary option &amp;gt; Choose the @sort field to aggregate on and set its aggregation function as "Minimum"&lt;/P&gt;&lt;P&gt;4. Suppress the summary field that CR places on the Group Footer&lt;/P&gt;&lt;P&gt;5. Go to the Group Sort Expert &amp;gt; Select Machine Group as the group to sort ALL and sort it based on the @sort summary field in Ascending order.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-Abhilash&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2020 22:43:59 GMT</pubDate>
    <dc:creator>abhilash_kumar</dc:creator>
    <dc:date>2020-04-20T22:43:59Z</dc:date>
    <item>
      <title>Crystal Reports - Conditional record sorting</title>
      <link>https://community.sap.com/t5/technology-q-a/crystal-reports-conditional-record-sorting/qaq-p/12128682</link>
      <description>&lt;P&gt;I'm attempting to sort report records based on multiple fields, but not as simple as Field A - ascending, Field B - descending, etc. My records have fields "machine", "fault", "magnitude", and "date". Machines are given a fault at a certain magnitude on a certain date. I want to sort based first on "magnitude" (descending) and then "machine"' (ascending), "fault" (ascending), and then "date" (ascending). However, the kicker is that a "machine" may have more than one "fault" and possibly assigned a different "magnitude". I want all "faults" assigned to the same "machine" to be sorted one after the other, even if the "faults" are different "magnitudes"&lt;/P&gt;
  &lt;P&gt;For example, Machine A has a fault assigned Significant. Machine B has two faults: Severe and Insignificant. Machine C has a fault assigned Severe. Machine D has a fault assigned Insignificant. Machine E has two faults both assigned Significant.&lt;/P&gt;
  &lt;P&gt;The correct order would be:&lt;/P&gt;
  &lt;P&gt;Machine B - severe&lt;/P&gt;
  &lt;P&gt;Machine B - insignificant&lt;/P&gt;
  &lt;P&gt;Machine C - severe&lt;/P&gt;
  &lt;P&gt;Machine A - significant&lt;/P&gt;
  &lt;P&gt;Machine E - significant 1&lt;/P&gt;
  &lt;P&gt;Machine E - significant 2&lt;/P&gt;
  &lt;P&gt;Machine D - insignificant&lt;/P&gt;
  &lt;P&gt;Essentially, I want the records to be supported based on "magnitude" but with "faults" regardless of "magnitudes" for identical "machines" to be kept together.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 19:48:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/crystal-reports-conditional-record-sorting/qaq-p/12128682</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-04-20T19:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Crystal Reports - Conditional record sorting</title>
      <link>https://community.sap.com/t5/technology-q-a/crystal-reports-conditional-record-sorting/qaa-p/12128683#M4532105</link>
      <description>&lt;P&gt;The only way I can think of to do this would be to use a Command (SQL Select statement).  How good are you SQL skills?  If you would like some help building the query, please go to the Database menu and then "Show SQL Query...", copy the query and paste it here.  Also, please let me know what type of database you're connecting to.&lt;/P&gt;&lt;P&gt;For more information about working with Commands, see the blog here:  &lt;A href="https://blogs.sap.com/2015/04/01/best-practices-when-using-commands-with-crystal-reports/"&gt;https://blogs.sap.com/2015/04/01/best-practices-when-using-commands-with-crystal-reports/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 20:20:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/crystal-reports-conditional-record-sorting/qaa-p/12128683#M4532105</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2020-04-20T20:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Crystal Reports - Conditional record sorting</title>
      <link>https://community.sap.com/t5/technology-q-a/crystal-reports-conditional-record-sorting/qaa-p/12128684#M4532106</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is there is a reason why Machine B appears before Machine C despite both having 'severe' faults?&lt;/P&gt;&lt;P&gt;Are these fault values static? Is there a certain fault that should always take precedence over others?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-Abhilash&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 21:09:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/crystal-reports-conditional-record-sorting/qaa-p/12128684#M4532106</guid>
      <dc:creator>abhilash_kumar</dc:creator>
      <dc:date>2020-04-20T21:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Crystal Reports - Conditional record sorting</title>
      <link>https://community.sap.com/t5/technology-q-a/crystal-reports-conditional-record-sorting/qaa-p/12128685#M4532107</link>
      <description>&lt;P&gt;*"Essentially, I want the records to be &lt;STRONG&gt;reported&lt;/STRONG&gt; based on..."&lt;/P&gt;&lt;P&gt;Machine B is before C because Machines will be in ascending order (after Magnitude descending order) and both Machines have a Severe fault (highest Magnitude value). All fields are static. Severe Magnitude takes precedence. There are four Magnitude values and are based on 0-10. 7-10 is severe. 4-7 is significant. 1-3 is insignificant. &amp;lt; 1 is normal. Machine, Fault, and Date have infinite values, for arguments sake.&lt;/P&gt;&lt;P&gt;The key is that Machine Faults, regardless of Magnitude remain grouped together (this is so my customer does not have to search through the report to find an additional problem on the same machine). But Magnitude is the primary sorting field i.e. if every Machine only had one Fault/Magnitude the report sorting would simply be "magnitude - descending" then "machine - ascending".&lt;/P&gt;&lt;P&gt;I forgot to mention that I am working with Crystal Reports 8.5 and that is a necessity. I also have CR 2016 but the report needs to be generated in 8.5.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 22:25:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/crystal-reports-conditional-record-sorting/qaa-p/12128685#M4532107</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-04-20T22:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Crystal Reports - Conditional record sorting</title>
      <link>https://community.sap.com/t5/technology-q-a/crystal-reports-conditional-record-sorting/qaa-p/12128686#M4532108</link>
      <description>&lt;P&gt;Ok here's what you need to do:&lt;/P&gt;&lt;P&gt;1. Insert a Group on the Machine field&lt;/P&gt;&lt;P&gt;2. Create a formula called  @sort with this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT {Fault_field} //replace this with the database field or formula field that displays Fault strings
CASE 'severe' : 1
CASE 'significant' : 2
CASE 'insignificant' : 3
DEFAULT: 4&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;3. Go to the Insert Summary option &amp;gt; Choose the @sort field to aggregate on and set its aggregation function as "Minimum"&lt;/P&gt;&lt;P&gt;4. Suppress the summary field that CR places on the Group Footer&lt;/P&gt;&lt;P&gt;5. Go to the Group Sort Expert &amp;gt; Select Machine Group as the group to sort ALL and sort it based on the @sort summary field in Ascending order.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-Abhilash&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 22:43:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/crystal-reports-conditional-record-sorting/qaa-p/12128686#M4532108</guid>
      <dc:creator>abhilash_kumar</dc:creator>
      <dc:date>2020-04-20T22:43:59Z</dc:date>
    </item>
  </channel>
</rss>

