<?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: Concat the list that have variable that changed in a loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Concat-the-list-that-have-variable-that-changed-in-a-loop/m-p/623697#M82257</link>
    <description>&lt;P&gt;See if this will give you what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 1, i &amp;lt;= 6, i++,
	bank_num = 6 * (k - 1) + i;
	theBankValue = Char( bank_num, 10, 0 );
	Eval(
		Substitute(
				Expr(
					bank_pcs = {"BGB1BESS001_B" || bank || "_W", "BGB1BESS001_B" || bank || "_A", "BGB1BESS001_V" || bank ||
					"_W"}
				),
			Expr( bank ), theBankValue
		)
	);
	bank_tags_i = bank_pcs;
	bank_tags = Concat( bank_tags, bank_tags_i );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 Apr 2023 01:52:48 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-04-19T01:52:48Z</dc:date>
    <item>
      <title>Concat the list that have variable that changed in a loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concat-the-list-that-have-variable-that-changed-in-a-loop/m-p/623675#M82252</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;I'm struggle to concat multiple list that has variable in it. I have a list, each item is string that is concatenated from a user-input variable. Since the variable is changed per loop, how I can get the list updated, and concat that list to other lists.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;bank_pcs = {"BGB1BESS001_B"||bank||"_W","BGB1BESS001_B"||bank||"_A","BGB1BESS001_V"||bank||"_W"};
For (i = 1, i&amp;lt;=6, i++,
		bank_num = 6*(k-1)+i;
		bank = char(bank_num,10,0);
		Eval list (bank_pcs);
		bank_tags_i = bank_pcs;	
		bank_tags = concat (bank_tags, bank_tags_i)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:08:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concat-the-list-that-have-variable-that-changed-in-a-loop/m-p/623675#M82252</guid>
      <dc:creator>mquyen</dc:creator>
      <dc:date>2023-06-09T16:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Concat the list that have variable that changed in a loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concat-the-list-that-have-variable-that-changed-in-a-loop/m-p/623697#M82257</link>
      <description>&lt;P&gt;See if this will give you what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 1, i &amp;lt;= 6, i++,
	bank_num = 6 * (k - 1) + i;
	theBankValue = Char( bank_num, 10, 0 );
	Eval(
		Substitute(
				Expr(
					bank_pcs = {"BGB1BESS001_B" || bank || "_W", "BGB1BESS001_B" || bank || "_A", "BGB1BESS001_V" || bank ||
					"_W"}
				),
			Expr( bank ), theBankValue
		)
	);
	bank_tags_i = bank_pcs;
	bank_tags = Concat( bank_tags, bank_tags_i );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Apr 2023 01:52:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concat-the-list-that-have-variable-that-changed-in-a-loop/m-p/623697#M82257</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-04-19T01:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Concat the list that have variable that changed in a loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concat-the-list-that-have-variable-that-changed-in-a-loop/m-p/623700#M82258</link>
      <description>&lt;P&gt;You were almost there.&amp;nbsp; You had the evallist(bank_pcs) but that's not what you're assigning to bank_tags_i.&amp;nbsp; This works for me.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);
bank_pcs = {"BGB1BESS001_B"||bank||"_W","BGB1BESS001_B"||bank||"_A","BGB1BESS001_V"||bank||"_W"};
For (i = 1, i&amp;lt;=6, i++,
    bank_num = i; // changing this from yours because I assume you also have a k loop
    bank = char(bank_num,10,0);
    bank_tags_i = Evallist(bank_pcs);	
    if(i==1, 
        bank_tags = bank_tags_i // just if it isn't started yet. you're probably doing this in your k loop
    , //else
        bank_tags = concat (bank_tags, bank_tags_i)
    )
);
bank_tags;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Apr 2023 02:35:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concat-the-list-that-have-variable-that-changed-in-a-loop/m-p/623700#M82258</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2023-04-19T02:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Concat the list that have variable that changed in a loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concat-the-list-that-have-variable-that-changed-in-a-loop/m-p/623788#M82265</link>
      <description>&lt;P&gt;or, if you want a list-of-lists:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;k = 11;
bank_tags = {};
bank_pcs = {"BGB1BESS001_B" || bank || "_W", "BGB1BESS001_B" || bank || "_A", "BGB1BESS001_V" || bank || "_W"};
For( i = 1, i &amp;lt;= 6, i++,
	bank_num = 6 * (k - 1) + i;
	bank = Char( bank_num, 10, 0 );
	bank_tags_i = Eval List( bank_pcs );
	bank_tags[1 + N Items( bank_tags )] = bank_tags_i;
);
Show( bank_tags );
/*{{"BGB1BESS001_B61_W", "BGB1BESS001_B61_A", "BGB1BESS001_V61_W"}, 
{"BGB1BESS001_B62_W", "BGB1BESS001_B62_A", "BGB1BESS001_V62_W"}, 
{"BGB1BESS001_B63_W", "BGB1BESS001_B63_A", "BGB1BESS001_V63_W"}, 
{"BGB1BESS001_B64_W", "BGB1BESS001_B64_A", "BGB1BESS001_V64_W"}, 
{"BGB1BESS001_B65_W", "BGB1BESS001_B65_A", "BGB1BESS001_V65_W"}, 
{"BGB1BESS001_B66_W", "BGB1BESS001_B66_A", "BGB1BESS001_V66_W"}}*/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want a string rather than a list, try &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2610"&gt;@vince_faller&lt;/a&gt;&amp;nbsp; answer with &lt;EM&gt;Concat Items( bank_tags, "," ) &lt;/EM&gt;to get the list items in a string with commas.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 11:17:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concat-the-list-that-have-variable-that-changed-in-a-loop/m-p/623788#M82265</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2023-04-19T11:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Concat the list that have variable that changed in a loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concat-the-list-that-have-variable-that-changed-in-a-loop/m-p/623948#M82283</link>
      <description>&lt;P&gt;Thank you! It works just as I expected.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 16:24:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concat-the-list-that-have-variable-that-changed-in-a-loop/m-p/623948#M82283</guid>
      <dc:creator>mquyen</dc:creator>
      <dc:date>2023-04-19T16:24:19Z</dc:date>
    </item>
  </channel>
</rss>

