<?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 Re: SQL select for Row values in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580096#M78353</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello &lt;A rel="user" href="https://answers.flexsim.com/users/35833/kavikaf.html" nodeid="35833"&gt;@Kavika F&lt;/A&gt; this is a HMLV model where i control the flow item process flow using a global table and where each type goes directly to any process without doing any connection with "A" , each item have diffetnt cycle time depending each processor .&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Every time that i create a flow item i need to to create a loop for get the values from the token ( on item creation) this is why i tried to do it with select. &lt;/P&gt;
 &lt;P&gt;Do you know a direct way to pass all the labels for the token to a flow item without do loops? maybe i can do it only one and use a select? &lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1682617183202.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516813i5330014FD7FC7E70/image-size/large?v=v2&amp;amp;px=999" role="button" title="1682617183202.png" alt="1682617183202.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1682617385650.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516814iD11B5D47210E5A64/image-size/large?v=v2&amp;amp;px=999" role="button" title="1682617385650.png" alt="1682617385650.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 27 Apr 2023 17:46:57 GMT</pubDate>
    <dc:creator>Raul_V</dc:creator>
    <dc:date>2023-04-27T17:46:57Z</dc:date>
    <item>
      <title>SQL select for Row values</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580092#M78349</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.1.1 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi team!&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;I need to create a select considering a row value (right now i use a for cycle but i would like to use a select statement if is possible)&lt;/P&gt;
 &lt;P&gt;Could you please help me to create a select considering a row value ? for examples&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;PRE&gt;Select colum header and value from row "X" where value in row is different to "0" ?&lt;/PRE&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;span class="lia-inline-image-display-wrapper" image-alt="1682523466601.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516816i70A046D7FF71DEB6/image-size/large?v=v2&amp;amp;px=999" role="button" title="1682523466601.png" alt="1682523466601.png" /&gt;&lt;/span&gt;
 &lt;PRE&gt;//Expected value is Type,2,CT,30,Col5,10,Col6,5&lt;/PRE&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Thanks a lot for the support&lt;/P&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/67528-queryforrows.fsm" target="_blank"&gt;QueryforRows.fsm&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 26 Apr 2023 15:45:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580092#M78349</guid>
      <dc:creator>Raul_V</dc:creator>
      <dc:date>2023-04-26T15:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: SQL select for Row values</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580093#M78350</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hey &lt;A rel="user" href="https://answers.flexsim.com/users/42734/raul-v.html" nodeid="42734"&gt;@Raul V&lt;/A&gt;, I'm curious as to why you want to use an &lt;A href="https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Table.html#Method-Table:~:text=4%5D%3B-,Table.query%28%29,-static%20Table%20query"&gt;SQL Table.query()&lt;/A&gt; if you are currently using a working for-loop. The performance of the two is nearly identical (considering the SQL query will still have to loop through the table to perform its analysis). SQL would not be ideal for the kind of output you're looking for because it doesn't have an easy way to query Column Headers, especially based upon value conditionals in each column.&lt;/P&gt;&lt;P&gt;Nevertheless, there are a few &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/23.1/Reference/DeveloperAdvancedUser/SQLQueries/SQLQueries.html" target="_blank"&gt;SQL Queries&lt;/A&gt; you could try to use to accomplish your objective. You could try a combination of &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/23.1/Reference/DeveloperAdvancedUser/SQLQueries/SQLQueries.html#:~:text=NULLIF%28val1%2C%20val2%29-,ARRAY,-%28val1%2C%20val2%2C%20...%29" target="_blank"&gt;ARRAY()&lt;/A&gt; and &lt;A rel="noopener noreferrer" href="https://www.w3schools.com/sql/sql_case.asp" target="_blank"&gt;CASE-WHEN-THEN-ELSE-END&lt;/A&gt; statements to construct something like this:&lt;/P&gt;&lt;PRE&gt;SELECT ARRAY(CASE WHEN [Col 1] != 0 THEN 'Col 1' ELSE '' END, ...)&lt;/PRE&gt;&lt;P&gt;You would have to construct a case &lt;STRONG&gt;for every column in your table&lt;/STRONG&gt; - if your table has 50 columns, you're writing 50 CASE statements.&lt;/P&gt;&lt;P&gt;You could also try the &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/23.1/Reference/DeveloperAdvancedUser/SQLQueries/SQLQueries.html#:~:text=MAP%28key1%2C%20val1%2C%20key2%2C%20val2%2C%20...%29%20%2D%20Although%20not%20part%20of%20the%20common%20SQL%20standard%2C%20this%20allows%20you%20to%20create%20a%20FlexSim%20Map%20object%20by%20defining%20individual%20key%2Dvalue%20pairs." target="_blank"&gt;MAP()&lt;/A&gt; function to group the headers and values in junction with the Select statement above, but I am struggling to see a good solution using it.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 26 Apr 2023 22:16:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580093#M78350</guid>
      <dc:creator>kavika_faleumu</dc:creator>
      <dc:date>2023-04-26T22:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: SQL select for Row values</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580094#M78351</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;Flexscript Class Api Data object &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Map.html" target="_blank"&gt;Map()&lt;/A&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Apr 2023 05:48:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580094#M78351</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2023-04-27T05:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: SQL select for Row values</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580095#M78352</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;You would normally use a different table structure for this where your columns are listed as rows in another table.&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Apr 2023 13:00:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580095#M78352</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-04-27T13:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: SQL select for Row values</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580096#M78353</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello &lt;A rel="user" href="https://answers.flexsim.com/users/35833/kavikaf.html" nodeid="35833"&gt;@Kavika F&lt;/A&gt; this is a HMLV model where i control the flow item process flow using a global table and where each type goes directly to any process without doing any connection with "A" , each item have diffetnt cycle time depending each processor .&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Every time that i create a flow item i need to to create a loop for get the values from the token ( on item creation) this is why i tried to do it with select. &lt;/P&gt;
 &lt;P&gt;Do you know a direct way to pass all the labels for the token to a flow item without do loops? maybe i can do it only one and use a select? &lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1682617183202.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516813i5330014FD7FC7E70/image-size/large?v=v2&amp;amp;px=999" role="button" title="1682617183202.png" alt="1682617183202.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1682617385650.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516814iD11B5D47210E5A64/image-size/large?v=v2&amp;amp;px=999" role="button" title="1682617385650.png" alt="1682617385650.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Apr 2023 17:46:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580096#M78353</guid>
      <dc:creator>Raul_V</dc:creator>
      <dc:date>2023-04-27T17:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: SQL select for Row values</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580097#M78354</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;PRE&gt;treenode labs=token.labels["item"].up;
labs.copy(labels(token.item),COPY_FLAG_REPLACE);&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 30 Apr 2023 23:38:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580097#M78354</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-04-30T23:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: SQL select for Row values</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580098#M78355</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Thanks a lot,
&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 May 2023 12:57:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/sql-select-for-row-values/m-p/13580098#M78355</guid>
      <dc:creator>Raul_V</dc:creator>
      <dc:date>2023-05-03T12:57:57Z</dc:date>
    </item>
  </channel>
</rss>

