<?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: Can you use Global Macros to reference the name of a row instead of the row #? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573020#M72831</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Sorry I don't like the idea of putting data in the global  macros are - usually they're deployed for speed and when you may need to change the format of a table in one place rather than throughout your code (e.g the number of fields and their order).  In this case it sounds like it will be more work and not priovide you with the fastest table access. &lt;/P&gt;&lt;P&gt;Can you tell us more about your use case since I now see from your screenshot that ConvertingAsset to SKU is not a one to one relationship. Which value will you know and which value(s). will you want to look up? Will you know single values or a pair of them?&lt;/P&gt;&lt;P&gt;For fast access you can use bundle tables with an index or you can create map of the rows to lookup, but I'd like to give you an example that will work for your case rather than have a number of rounds of suggestions followed by more refined examples of your requirements.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 20 Mar 2023 20:59:22 GMT</pubDate>
    <dc:creator>jason_lightfoot_adsk</dc:creator>
    <dc:date>2023-03-20T20:59:22Z</dc:date>
    <item>
      <title>Can you use Global Macros to reference the name of a row instead of the row #?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573017#M72828</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 22.2.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;I am trying to pull data from a table using a Global Macro. However, I want to label each of my rows with a SKU #. Can I make the Global Macro the SKU #? Or do Global Macros only work with Row #s? &lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 20 Mar 2023 14:29:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573017#M72828</guid>
      <dc:creator>sofia_garciarojas</dc:creator>
      <dc:date>2023-03-20T14:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use Global Macros to reference the name of a row instead of the row #?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573018#M72829</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Macros just replace their occurrence throughout your code with the text you defined, so if the expression evaluates correctly in a script you can use it as your macro definition.&lt;/P&gt;&lt;PRE&gt;Table("GlobalTable1")["Row1"]["Col1"] &amp;nbsp; &amp;nbsp;&lt;/PRE&gt;&lt;P&gt;is a valid expression for a macro that uses the names of rows and columns.&lt;/P&gt;&lt;P&gt;If this isn't what you meant, then please include an example of what you were wanting to try.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;: re-reading the question it sounds like you want to have in your code:&lt;/P&gt;&lt;PRE&gt;Table("GlobalTable")[SKU1]["Col1"]&lt;/PRE&gt;&lt;P&gt;where SKU1 is defined as&lt;/P&gt;&lt;PRE&gt;#define SKU1 "Row1"&lt;/PRE&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/39182/sofiag21.html" nodeid="39182"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;which will work.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Update2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I think I've finally latched onto what you want which is to have "09343558" as the row name. In the past we tried to avoid having number values for row headers and so I added ":" at the beginning so that they forced evaluation as a string in paths so ":09343558" - which of course can also have a macro definition.&lt;/P&gt;&lt;P&gt;My concern would be that if you have thousands of SKUs do you really want to create macros for them all? It suggests you're semi-hard coding your logic ('semi' since you can change the macro definitions)  which might not be the best approach.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 20 Mar 2023 14:37:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573018#M72829</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-03-20T14:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use Global Macros to reference the name of a row instead of the row #?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573019#M72830</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="screenshot-2023-03-20-150040.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516153i93455517DAE971A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot-2023-03-20-150040.png" alt="screenshot-2023-03-20-150040.png" /&gt;&lt;/span&gt;Hey Jason, thanks for the various solutions you've provided. Here is what I'm trying to do: &lt;/P&gt;
 &lt;P&gt;I have a global table. The first column has the number of all of the SKUs (there's only 100). Instead of creating a global macro for the row number (which is difficult to track), I'd rather just call up the row with a Global Macro for its name which is the SKU #. From your notes, I assume this is how you're suggesting I build it? Is this correct? &lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 20 Mar 2023 19:01:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573019#M72830</guid>
      <dc:creator>sofia_garciarojas</dc:creator>
      <dc:date>2023-03-20T19:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use Global Macros to reference the name of a row instead of the row #?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573020#M72831</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Sorry I don't like the idea of putting data in the global  macros are - usually they're deployed for speed and when you may need to change the format of a table in one place rather than throughout your code (e.g the number of fields and their order).  In this case it sounds like it will be more work and not priovide you with the fastest table access. &lt;/P&gt;&lt;P&gt;Can you tell us more about your use case since I now see from your screenshot that ConvertingAsset to SKU is not a one to one relationship. Which value will you know and which value(s). will you want to look up? Will you know single values or a pair of them?&lt;/P&gt;&lt;P&gt;For fast access you can use bundle tables with an index or you can create map of the rows to lookup, but I'd like to give you an example that will work for your case rather than have a number of rounds of suggestions followed by more refined examples of your requirements.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 20 Mar 2023 20:59:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573020#M72831</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-03-20T20:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use Global Macros to reference the name of a row instead of the row #?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573021#M72832</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hey Jason, to reference the screenshot, the Row Name is 1 to 1 to the SKU column. (It doesn't really matter if Converting Asset or SKU is the first column for my use; I could really delete the SKU column if need be). Here's what I'm trying to do:&lt;/P&gt;
 &lt;P&gt;- I have 25 sources that depending on the SKU they run, they will have a different Inter-Arrival time. Each source can run 3+ SKUs, but only one SKU at a time.&lt;/P&gt;
 &lt;P&gt;- Every time I run the simulation, I want to say which 25 SKUs will be run. I was hoping of doing this using Global Macros, where I could type which SKU runs on which source ('Converting Asset') and it could pull it from the Global Table. This is where I thought it might be easier to have the Macro use the SKU to recall the row, instead of just recalling the row #. &lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Mar 2023 11:33:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573021#M72832</guid>
      <dc:creator>sofia_garciarojas</dc:creator>
      <dc:date>2023-03-21T11:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use Global Macros to reference the name of a row instead of the row #?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573022#M72833</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P id="isPasted"&gt;Is just setting the source to run 1 of the 3 SKUs short-sighted? Will you not at some point need to run more SKUs?&lt;/P&gt;&lt;P&gt;It sounds like the source needs to understand the SKU and interarrival rate so you will have the converting Asset name and want to look up the SKU and its rate.&lt;/P&gt;&lt;P&gt;Rather than look this up for every item processed one approach would be to set the values at reset, or when you change SKU. In the attached model I've used this approach to read the configuratuion from the table ConfigData - where I use an extra column "Active" to indicate if that's the SKU/Asset combination in use.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/66030-setassetconfig.fsm" target="_blank"&gt;setAssetConfig.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Mar 2023 12:18:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573022#M72833</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-03-21T12:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use Global Macros to reference the name of a row instead of the row #?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573023#M72834</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hey Jason, ok, I see what you're talking about now. It can become a rabbit hole, but I like your suggestion. Let me give it a shot, I think it should work. Once again, thanks so much for the help! I really appreciate it!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Mar 2023 19:20:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573023#M72834</guid>
      <dc:creator>sofia_garciarojas</dc:creator>
      <dc:date>2023-03-23T19:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use Global Macros to reference the name of a row instead of the row #?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573024#M72835</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/39182/sofiag21.html" nodeid="39182"&gt;@Sofia G21&lt;/A&gt;, was our answer helpful? If so, please click the "Accept" button at the bottom of an answer. Or if you still have questions, add a comment and we'll continue the conversation.&lt;/P&gt;&lt;P&gt;If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 Mar 2023 15:24:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-you-use-global-macros-to-reference-the-name-of-a-row-instead/m-p/13573024#M72835</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-03-29T15:24:58Z</dc:date>
    </item>
  </channel>
</rss>

