<?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>topic Sort by element of an array in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563301#M65377</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.1.1 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello guys,&lt;/P&gt;
 &lt;P&gt;Is it possible to sort a query result by an element inside an array ?&lt;span class="lia-inline-image-display-wrapper" image-alt="27862-capture.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501992i792EBE57F3198B2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="27862-capture.jpg" alt="27862-capture.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;The above table is the result of a query from a larger table. Is it possible to add a condition to the query that it will sort by the first element of the Array so I can have the following result ?&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="27839-capture-result.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501994i0D2C237CCB18AB78/image-size/large?v=v2&amp;amp;px=999" role="button" title="27839-capture-result.jpg" alt="27839-capture-result.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;Thank you.&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 30 Apr 2020 06:57:02 GMT</pubDate>
    <dc:creator>marian_cretu</dc:creator>
    <dc:date>2020-04-30T06:57:02Z</dc:date>
    <item>
      <title>Sort by element of an array</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563301#M65377</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.1.1 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello guys,&lt;/P&gt;
 &lt;P&gt;Is it possible to sort a query result by an element inside an array ?&lt;span class="lia-inline-image-display-wrapper" image-alt="27862-capture.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501992i792EBE57F3198B2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="27862-capture.jpg" alt="27862-capture.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;The above table is the result of a query from a larger table. Is it possible to add a condition to the query that it will sort by the first element of the Array so I can have the following result ?&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="27839-capture-result.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501994i0D2C237CCB18AB78/image-size/large?v=v2&amp;amp;px=999" role="button" title="27839-capture-result.jpg" alt="27839-capture-result.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;Thank you.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Apr 2020 06:57:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563301#M65377</guid>
      <dc:creator>marian_cretu</dc:creator>
      <dc:date>2020-04-30T06:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by element of an array</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563302#M65378</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;@Marian Cretu, next time please add a model. It is so time consuming to build your image table myself.&lt;SPAN class="mention-at-signal" id="mention-at-signal-2"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Apr 2020 07:17:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563302#M65378</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2020-04-30T07:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by element of an array</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563303#M65379</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Sorry Jorg. Here is the file. Thank you so much.&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/temp/27872-sort-by-array-element.fsm" target="_blank"&gt;sort by array element.fsm&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Apr 2020 07:35:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563303#M65379</guid>
      <dc:creator>marian_cretu</dc:creator>
      <dc:date>2020-04-30T07:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by element of an array</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563304#M65380</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;PRE&gt;Table.query("SELECT $2 AS rack, $3 AS pallet_details FROM $1 ORDER BY $4 ASC",&amp;nbsp; &amp;nbsp; 
   /*$1*/Table("GlobalTable1").numRows,&amp;nbsp; &amp;nbsp; 
   /*$2*/Table("GlobalTable1")[$iter(1)][1],&amp;nbsp; &amp;nbsp; 
   /*$3*/Table("GlobalTable1")[$iter(1)][2],&amp;nbsp; &amp;nbsp; 
   /*$4*/Table("GlobalTable1")[$iter(1)][2].as(Array)[1]).cloneTo(Table("dump"));&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="27873-table-query-by-array-element.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501984i86DE6FAEC576C446/image-size/large?v=v2&amp;amp;px=999" role="button" title="27873-table-query-by-array-element.png" alt="27873-table-query-by-array-element.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Apr 2020 07:36:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563304#M65380</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2020-04-30T07:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by element of an array</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563305#M65381</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;much shorter:&lt;/P&gt;&lt;PRE&gt;Table.query("SELECT $2 AS rack, $3 AS pallet_details FROM $1 ORDER BY $3[1] ASC",&amp;nbsp; &amp;nbsp; 
  /*$1*/Table("GlobalTable1").numRows,&amp;nbsp; &amp;nbsp; 
  /*$2*/Table("GlobalTable1")[$iter(1)][1],&amp;nbsp; &amp;nbsp; 
  /*$3*/Table("GlobalTable1")[$iter(1)][2]).cloneTo(Table("dump"));&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Apr 2020 07:39:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563305#M65381</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2020-04-30T07:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by element of an array</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563306#M65382</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello Jorg, Thank you for your answer. It sorts correctly. On this query I need to also add a condition WHERE rack="1" but it doesnt seem to work. Can you please advise ? Thank you.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Apr 2020 07:56:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563306#M65382</guid>
      <dc:creator>marian_cretu</dc:creator>
      <dc:date>2020-04-30T07:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by element of an array</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563307#M65383</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;PRE&gt;Table.query("SELECT $2 AS rack, $3 AS pallet_details FROM $1 WHERE rack = 1 ORDER BY $3[1] ASC",&amp;nbsp; &amp;nbsp; 
  /*$1*/Table("GlobalTable1").numRows,&amp;nbsp; &amp;nbsp; 
  /*$2*/Table("GlobalTable1")[$iter(1)][1],&amp;nbsp; &amp;nbsp; 
  /*$3*/Table("GlobalTable1")[$iter(1)][2]).cloneTo(Table("dump"));&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Apr 2020 08:08:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563307#M65383</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2020-04-30T08:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by element of an array</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563308#M65384</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Great thank you!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Apr 2020 08:17:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sort-by-element-of-an-array/m-p/13563308#M65384</guid>
      <dc:creator>marian_cretu</dc:creator>
      <dc:date>2020-04-30T08:17:10Z</dc:date>
    </item>
  </channel>
</rss>

