<?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: Concatenation of Names using SQL to Update Maps in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600943#M94683</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 Hi 
 &lt;A rel="user" href="https://answers.flexsim.com/users/42833/abajpai.html" nodeid="42833"&gt;@Abhay Bajpai&lt;/A&gt; ,
 &lt;P&gt;Can you re-attach your model? I can't download it&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Mon, 31 Jul 2023 21:47:54 GMT</pubDate>
    <dc:creator>carter-walch</dc:creator>
    <dc:date>2023-07-31T21:47:54Z</dc:date>
    <item>
      <title>Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600934#M94674</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.1.2 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Objective: To put unique names (in a map called "PartMap") of item that need to be summoned at each station. Each station has specific items that get added on top of the flow item "Floor". &lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;I have 8 columns. Column 1 is stationID. Column 2 is MODEL_NAME. Column 3 MODE_PART and Column 4 onwards to column 8 are for options. Options header should be concatenated to the end of Model_Part if the the value in the row for that Model_Part under an option is "1". If it is blank, then no concatenation required. The nomenclature I am trying to achieve should be "MODEL_NANE-MODEL_PART-OPTION header" (OPTION is conditional if present)&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1690471248484.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518676i5FFC31CF4232533D/image-size/large?v=v2&amp;amp;px=999" role="button" title="1690471248484.png" alt="1690471248484.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;Model and Part name columns have values in all rows but not the option names. Option names have only have one value "1". Columns 3 through 10 headers are the names of the options. If that option has a value 1 against the model name, that means that option is present in the model. For example, row 1 has a model name "Model 1", part name "Floor" and under column 3 option header "Option 1", there is the number 1 means that Option 1 is present in Model 1's Part "Floor". Another example, | Model 2 | Wall | 0 | then it should display "Model 2-Wall" since The Model_Part "WALL" does not have any options.&lt;span class="lia-inline-image-display-wrapper" image-alt="1690471151403.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518677i52D02C2750666754/image-size/large?v=v2&amp;amp;px=999" role="button" title="1690471151403.png" alt="1690471151403.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/226/jason.l.html" nodeid="226"&gt;@Jason Lightfoot&lt;/A&gt; &lt;/P&gt;
 &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/71797-championhomes-v7-abhay-1.fsm" target="_blank"&gt;ChampionHomes_V7_Abhay_1.fsm&lt;/A&gt;
 &lt;P&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Jul 2023 15:39:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600934#M94674</guid>
      <dc:creator>ABajpaiWMKNX</dc:creator>
      <dc:date>2023-07-27T15:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600935#M94675</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/42833/abajpai.html" nodeid="42833"&gt;@Abhay Bajpai&lt;/A&gt; ,&lt;/P&gt;
 &lt;P id="isPasted"&gt;Here is a SQL query you can use to create your table with the concatenated column:&lt;/P&gt;
 &lt;PRE&gt;string sql = "SELECT MODEL_NAME, MODEL_PART, MODEL_NAME + '-' + MODEL_PART + '-' + \
CASE \
WHEN OPTION_1 = 1 THEN 'OPTION_1' \
WHEN OPTION_2 = 1 THEN 'OPTION_2' \
WHEN OPTION_3 = 1 THEN 'OPTION_3' \
WHEN OPTION_4 = 1 THEN 'OPTION_4' \
WHEN OPTION_5 = 1 THEN 'OPTION_5' \
ELSE '' \
END AS CONCATENATED_NAME \
FROM OptionsTable";
Table result=Table.query(sql);
result.cloneTo(Table("temp3"));&lt;/PRE&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1690478015534.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518657i5278E0F87ED7723F/image-size/large?v=v2&amp;amp;px=999" role="button" title="1690478015534.png" alt="1690478015534.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;What do you want the value to look like when multiple Option columns have a 1 value? I also changed your column headers from 'OPTION 1' to OPTION_1 to avoid errors with spaces in names in SQL&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Jul 2023 17:12:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600935#M94675</guid>
      <dc:creator>carter-walch</dc:creator>
      <dc:date>2023-07-27T17:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600936#M94676</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;Can you describe what your trying to do at a higher level to see if there's a better way that this concatenation?&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Jul 2023 17:46:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600936#M94676</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-07-27T17:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600937#M94677</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;So the parts that go on top of the flow item now come with various options that customers can add. So i thought i would create a repository of options similar to parts in the flor bin. For example a standard floor part can be called "M1A_Floor_A" which is a floor on the A side of house of model M1. If customer chooses an option 1 or option 2 in Floor_A, then flexsim will need to search 'Option 1' of 'Floor_A'. So i thought i would create an item called "M1A_Floor_A_Option 1". Do you think there is a better way?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Jul 2023 19:38:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600937#M94677</guid>
      <dc:creator>ABajpaiWMKNX</dc:creator>
      <dc:date>2023-07-27T19:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600938#M94678</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Good question. I believe if one column is checked, the other column won't be checked. There can only be one kind of option. But now that you brought it up, if multiple options were to be added, how would we update the code?
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Also is there a way to execute the custom code without calling it in process flow? Just to see if the code works or for debugging purposes?&lt;/P&gt; 
&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jul 2023 15:21:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600938#M94678</guid>
      <dc:creator>ABajpaiWMKNX</dc:creator>
      <dc:date>2023-07-28T15:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600939#M94679</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Gotcha. If there can only be one option then the code above should work. You can modify it to look like this so the '-' doesn't show up if no option is selected:&lt;/P&gt;
 &lt;PRE&gt;string sql = "SELECT MODEL_NAME, MODEL_PART, MODEL_NAME + '-' + MODEL_PART + \
CASE \
WHEN OPTION_1 = 1 THEN '-OPTION_1' \
WHEN OPTION_2 = 1 THEN '-OPTION_2' \
WHEN OPTION_3 = 1 THEN '-OPTION_3' \
WHEN OPTION_4 = 1 THEN '-OPTION_4' \
WHEN OPTION_5 = 1 THEN '-OPTION_5' \
ELSE '' \
END AS CONCATENATED_NAME \
FROM OptionsTable";
Table result=Table.query(sql);
result.cloneTo(Table("temp4"));&lt;/PRE&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1690562696853.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518661i21F6E34E272A4CCE/image-size/large?v=v2&amp;amp;px=999" role="button" title="1690562696853.png" alt="1690562696853.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;If &lt;STRONG&gt;multiple options&lt;/STRONG&gt; are to be added, you can modify the code to have several CASE statements and concatenate the string only if there is a 1 in that column. Here is what that looks like:&lt;/P&gt;
 &lt;PRE&gt;string sql = "SELECT MODEL_NAME, MODEL_PART, MODEL_NAME + '-' + MODEL_PART + \
CASE WHEN OPTION_1 = 1 THEN '-OPTION_1' ELSE '' END + \
CASE WHEN OPTION_2 = 1 THEN '-OPTION_2' ELSE '' END + \
CASE WHEN OPTION_3 = 1 THEN '-OPTION_3' ELSE '' END + \
CASE WHEN OPTION_4 = 1 THEN '-OPTION_4' ELSE '' END + \
CASE WHEN OPTION_5 = 1 THEN '-OPTION_5' ELSE '' END AS CONCATENATED_NAME \
FROM OptionsTable";
Table result=Table.query(sql);
result.cloneTo(Table("temp3"));&lt;/PRE&gt;
 &lt;P&gt;For example, Row 8 has all options checked so they are all added to the concatenated name:&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1690562874491.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518662i75BFC9240019BDA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="1690562874491.png" alt="1690562874491.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1690562902251.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518663iD875DEBA3EDAD0BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="1690562902251.png" alt="1690562902251.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;A useful tool for executing code and debugging is the Script Console (see link for documentation). If you paste either of the code blocks above into a script window and execute them, the changes will be made to your tables. Here is a gif demonstrating that:&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="scriptwindow.gif"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518665i684FFE1B758BB7A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="scriptwindow.gif" alt="scriptwindow.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jul 2023 16:51:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600939#M94679</guid>
      <dc:creator>carter-walch</dc:creator>
      <dc:date>2023-07-28T16:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600940#M94680</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Wonderful! That was very helpful!&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Use case: the use of the concatenated name is to then use a Map function at each station to call on the concatenated names for the respective stations. For station 1, the map should store the concatenated values corresponding to the stations. Do you think this is the correct approach?&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1690566369409.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518664iC6BA99D785C02921/image-size/large?v=v2&amp;amp;px=999" role="button" title="1690566369409.png" alt="1690566369409.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;Also, I have been trying to find the "Accept Answer" button under my post but cannot seem to find it. &lt;span class="lia-inline-image-display-wrapper" image-alt="Image.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520162i34D48BC5EC6AAC9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Image.png" alt="Image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jul 2023 17:47:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600940#M94680</guid>
      <dc:creator>ABajpaiWMKNX</dc:creator>
      <dc:date>2023-07-28T17:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600941#M94681</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Glad it helped! Yes I believe that using a Map function would work to accomplish this as long as the keys match what the customers are choosing&lt;/P&gt;
 &lt;P&gt;And I now converted it to an answer instead of a comment&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jul 2023 18:06:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600941#M94681</guid>
      <dc:creator>carter-walch</dc:creator>
      <dc:date>2023-07-28T18:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600942#M94682</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/42834/carter-walch.html" nodeid="42834"&gt;@Carter Walch&lt;/A&gt; i tried using the SQL for a similar issue where the logic is: TAKE CYCLE TIME AS THE BASELINE AND ADD OPTION VALUES TO CYCLE TIME IF THE OPTION VALUE IS MORE THAN 1 and name that column as Aggregated_Time. For example, if cycle time is 100 and option has any value other than 0,say 50, it should take that options value (50) and add it to cycle time (100) and make it 150 under Aggregated_time for that Model_Name. I tried it but for some reason i cannot seem to parse the string through the query.&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/72011-championhomes-v7-abhay-2.fsm" target="_blank"&gt;ChampionHomes_V7_Abhay_2.fsm&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1690836818127.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518666i79387B8E5F6244AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="1690836818127.png" alt="1690836818127.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 31 Jul 2023 20:36:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600942#M94682</guid>
      <dc:creator>ABajpaiWMKNX</dc:creator>
      <dc:date>2023-07-31T20:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600943#M94683</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Hi 
 &lt;A rel="user" href="https://answers.flexsim.com/users/42833/abajpai.html" nodeid="42833"&gt;@Abhay Bajpai&lt;/A&gt; ,
 &lt;P&gt;Can you re-attach your model? I can't download it&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 31 Jul 2023 21:47:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600943#M94683</guid>
      <dc:creator>carter-walch</dc:creator>
      <dc:date>2023-07-31T21:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600944#M94684</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/72000-championhomes-v7-abhay-2.fsm" target="_blank"&gt;ChampionHomes_V7_Abhay_2.fsm&lt;/A&gt; &lt;SPAN id="isPasted" style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;Hi Carter, try this one. Let me &lt;/SPAN&gt;know if it worked. I also reattached the model in my previous comment just in case&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 00:09:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600944#M94684</guid>
      <dc:creator>ABajpaiWMKNX</dc:creator>
      <dc:date>2023-08-01T00:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600945#M94685</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thank you, reattaching it worked. I may have misunderstood but aren't the Option values only 0 or 1? Or are you wanting to pull them from another table?&lt;BR /&gt;&lt;BR /&gt;This query makes the AggregatedTime column by adding the option value to CYCLE_TIME&lt;/P&gt;
 &lt;PRE&gt;sql="SELECT CYCLE_TIME, OPTION_1, OPTION_2, OPTION_3, OPTION_4, OPTION_5,  \
CASE \
WHEN OPTION_1 &amp;gt; 0 THEN CYCLE_TIME + OPTION_1 \
WHEN OPTION_2 &amp;gt; 0 THEN CYCLE_TIME + OPTION_2 \
WHEN OPTION_3 &amp;gt; 0 THEN CYCLE_TIME + OPTION_3 \
WHEN OPTION_4 &amp;gt; 0 THEN CYCLE_TIME + OPTION_4 \
WHEN OPTION_5 &amp;gt; 0 THEN CYCLE_TIME + OPTION_5 \
ELSE CYCLE_TIME \
END AS AggregatedTime \
FROM OptionsTable \
WHERE stationID='"+stationID+"'";&lt;/PRE&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1690905540482.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518669iBECD3015D194539D/image-size/large?v=v2&amp;amp;px=999" role="button" title="1690905540482.png" alt="1690905540482.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 16:00:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600945#M94685</guid>
      <dc:creator>carter-walch</dc:creator>
      <dc:date>2023-08-01T16:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600946#M94686</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Carter, you understood it perfectly. The Options columns had 1 or 0 initially as the binary input of saying if the option is present or not. &lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;I think I messed up the vision on how I should be achieving this. I think i will have to make another global table with 'Model Name' and 'Options_1 time','Options_2 time','Options_3 time' etc to add their times to 'Cycle Time' if their respective 'Options_1' column in table OptionsTable have a value "1" in it. If they are not present (having the 0 value in OptionsTable), then the time for that option will not be added to Cycle Time. Hope this makes sense. I apologize for being non-descript earlier.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;I guess I will somehow have to merge both of the solutions you provided.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 16:07:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600946#M94686</guid>
      <dc:creator>ABajpaiWMKNX</dc:creator>
      <dc:date>2023-08-01T16:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600947#M94687</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;No that makes perfect sense. If you make that table with each Options time value, we can easily join that table in the SQL query and pull the actual time values to add to CYCLE_TIME. Let me know if you need anything in that process&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 16:17:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600947#M94687</guid>
      <dc:creator>carter-walch</dc:creator>
      <dc:date>2023-08-01T16:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600948#M94688</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Ok so here is what i think: There are two tables of interest here: OptionsTable and OptionsTimeTable.&lt;/P&gt;
 &lt;P&gt;OptionsTable:&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Image.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520163i7CB3A1694FEADA43/image-size/large?v=v2&amp;amp;px=999" role="button" title="Image.png" alt="Image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;OptionsTimeTable:&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1691072768774.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518673iB60396D4F45597B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="1691072768774.png" alt="1691072768774.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;I guess the query should say: Merge two tables where the value under each Options column is 1 in OptionsTable and display the number from OptionsTimeTable? Am I thinking right? If you can help me with the statement, that would be awesome!&lt;/P&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/72176-championhomes-v7-abhay-2.fsm" target="_blank"&gt;ChampionHomes_V7_Abhay_2.fsm&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 14:29:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600948#M94688</guid>
      <dc:creator>ABajpaiWMKNX</dc:creator>
      <dc:date>2023-08-03T14:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600949#M94689</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Yes that is correct. As long as we have a primary key that connects the two tables (in this case a composite primary key of stationID and MODEL_NAME), we can join the tables so that when an Option is 1 in the OptionsTable, we will add the time value from OptionsTimeTable&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;I believe the model you attached is an older version because I don't see the OptionsTimeTable, I have a query that should work but if you reattach the new version I can test it&lt;/P&gt;
 &lt;PRE&gt;sql="SELECT CYCLE_TIME, OPTION_1, OPTION_2, OPTION_3, OPTION_4, OPTION_5,  \
CASE \
WHEN OPTION_1 &amp;gt; 0 THEN CYCLE_TIME + OptionsTimeTable.[OPTION 1] \
WHEN OPTION_2 &amp;gt; 0 THEN CYCLE_TIME + OptionsTimeTable.[OPTION 2] \
WHEN OPTION_3 &amp;gt; 0 THEN CYCLE_TIME + OptionsTimeTable.[OPTION 3] \
WHEN OPTION_4 &amp;gt; 0 THEN CYCLE_TIME + OptionsTimeTable.[OPTION 4] \
WHEN OPTION_5 &amp;gt; 0 THEN CYCLE_TIME + OptionsTimeTable.[OPTION 5] \
ELSE CYCLE_TIME \
END AS AggregatedTime \
FROM OptionsTable, OptionsTimeTable \
WHERE \
stationID='"+stationID+"'\
AND OptionsTable.stationID = OptionsTimeTable.STATION \
AND OptionsTable.MODEL_NAME = OptionsTimeTable.[MODEL NAME]";&lt;/PRE&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 16:50:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600949#M94689</guid>
      <dc:creator>carter-walch</dc:creator>
      <dc:date>2023-08-03T16:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600950#M94690</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Apologize for that. I have updated the model in the previous comment and attached it here as well. &lt;/P&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/72186-championhomes-v7-abhay-2.fsm" target="_blank"&gt;ChampionHomes_V7_Abhay_2.fsm&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 17:44:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600950#M94690</guid>
      <dc:creator>ABajpaiWMKNX</dc:creator>
      <dc:date>2023-08-03T17:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600951#M94691</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Carter, it worked like a charm! Thanks a lot buddy! Is SQL on Flexsim's website the only source to learn about it?
&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 17:58:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600951#M94691</guid>
      <dc:creator>ABajpaiWMKNX</dc:creator>
      <dc:date>2023-08-03T17:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600952#M94692</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Sure thing! I'm glad it worked out! There's a lot of online material for learning SQL like w3schools, but the FlexSim manual is very useful for what SQL commands specifically work in FlexSim. &lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;For example, I like this site for learning INNER JOIN but I double check the FlexSim syntax in the manual (see 'Joins') to see how you would do the same thing in FlexSim. &lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Hope that helps!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 18:52:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600952#M94692</guid>
      <dc:creator>carter-walch</dc:creator>
      <dc:date>2023-08-03T18:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation of Names using SQL to Update Maps</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600953#M94693</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hey Carter,&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Here is a weird error that i received upon clicking on "Apply All" in the User Command "WriteStationMaps".&lt;/P&gt;
 &lt;P&gt;Basically after making changes, I clicked on "Apply" button instead and then ran the model and it would not parse the string saved in 'sql' variable. It will just skip the iteration.&lt;/P&gt;
 &lt;P&gt;I was wondering if you could help me with this error. I have attached the model here.&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1694807672942.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1518675i9AB85CFB3914870B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1694807672942.png" alt="1694807672942.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/73751-championhomes-v7-abhay-7-autosave.fsm" target="_blank"&gt;ChampionHomes_V7_Abhay_7_autosave.fsm&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 Sep 2023 19:51:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/concatenation-of-names-using-sql-to-update-maps/m-p/13600953#M94693</guid>
      <dc:creator>ABajpaiWMKNX</dc:creator>
      <dc:date>2023-09-15T19:51:49Z</dc:date>
    </item>
  </channel>
</rss>

