<?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: Creating a new dynamic column in the script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Creating-a-new-dynamic-column-in-the-script/m-p/2079327#M88529</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;try this code&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;tmp:
Load 
pessoa,
ends as Ends,
substringcount(ends,'|') As ContFields
;
LOAD
    pessoa,
    ends
FROM [lib://AttachedFiles/TestLoad.xlsx]
(ooxml, embedded labels, table is Sheet1);


 vL.tbnum = NoOfRows('tmp');
 
 for x = 0  to $(vL.tbnum) -1
 
 	vL.Num = peek('ContFields',$(x),'tmp')
 	
    	for  y = 1 to $(vL.Num)
        
        Pessoa_end:
        Load
        	pessoa,
            SubField(Ends,'|', $(y))	As Endereco
        resident tmp
        ;
               
        next y;
 	
 
 next x;
 
 drop Table tmp;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2023 09:28:18 GMT</pubDate>
    <dc:creator>srchagas</dc:creator>
    <dc:date>2023-06-02T09:28:18Z</dc:date>
    <item>
      <title>Creating a new dynamic column in the script</title>
      <link>https://community.qlik.com/t5/App-Development/Creating-a-new-dynamic-column-in-the-script/m-p/2078402#M88454</link>
      <description>&lt;P&gt;Olá, estou precisando de ajuda para via script realizar a contagem de caracter "|" de um campoEndereços e em sequência separar esse campoEndereços em diversos camposEndereçoX.&lt;/P&gt;
&lt;P&gt;exemplo do campoEndereços:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Av. Wilson Alvarenga de Oliveira, 410 Viúva 35970-000 (31) 3837-7450 Barão de Cocais | &lt;BR /&gt;Rua Quinze de Novembro, 200 Centro 36200-740 (32) 3052-4200 Barbacena | &lt;BR /&gt;Av. Governador Bias Fortes, 841 Caminho Novo 36204-168 (32) 3339-5150 Barbacena | &lt;BR /&gt;Rua Tupinambás, 462 Centro 30120-700 (31) 3217-1151 Belo Horizonte | &lt;BR /&gt;Av. Afonso Vaz de Melo, 399 Barreiro 30640-700 (31) 3389-6300 Belo Horizonte&lt;/P&gt;
&lt;P&gt;Tentei sem sucesso azer assim:&lt;/P&gt;
&lt;P&gt;[Plan1]:&lt;BR /&gt;LOAD&lt;BR /&gt;[A] AS [Ends], &lt;BR /&gt;Len([Ends]) - Len(Replace([Ends], '|', '')) + 1 as NumEnds&lt;BR /&gt;Resident ;&lt;BR /&gt;&lt;BR /&gt;FOR i = 1 TO NumEnds&lt;BR /&gt;LET Campoendereco = Peek('Ends', $(i) - 1);&lt;BR /&gt;Campoendereco:&lt;BR /&gt;LOAD&lt;BR /&gt;Trim(SubField(Campoendereco, '|', $(i))) as Ends_$(i)&lt;BR /&gt;Autogenerate 1;&lt;BR /&gt;NEXT&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 13:28:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Creating-a-new-dynamic-column-in-the-script/m-p/2078402#M88454</guid>
      <dc:creator>pinheirf</dc:creator>
      <dc:date>2023-05-31T13:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new dynamic column in the script</title>
      <link>https://community.qlik.com/t5/App-Development/Creating-a-new-dynamic-column-in-the-script/m-p/2079327#M88529</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;try this code&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;tmp:
Load 
pessoa,
ends as Ends,
substringcount(ends,'|') As ContFields
;
LOAD
    pessoa,
    ends
FROM [lib://AttachedFiles/TestLoad.xlsx]
(ooxml, embedded labels, table is Sheet1);


 vL.tbnum = NoOfRows('tmp');
 
 for x = 0  to $(vL.tbnum) -1
 
 	vL.Num = peek('ContFields',$(x),'tmp')
 	
    	for  y = 1 to $(vL.Num)
        
        Pessoa_end:
        Load
        	pessoa,
            SubField(Ends,'|', $(y))	As Endereco
        resident tmp
        ;
               
        next y;
 	
 
 next x;
 
 drop Table tmp;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 09:28:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Creating-a-new-dynamic-column-in-the-script/m-p/2079327#M88529</guid>
      <dc:creator>srchagas</dc:creator>
      <dc:date>2023-06-02T09:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new dynamic column in the script</title>
      <link>https://community.qlik.com/t5/App-Development/Creating-a-new-dynamic-column-in-the-script/m-p/2079493#M88556</link>
      <description>&lt;P&gt;Muito obrigado pela ajuda. Funcionou! agora os campos podem ser separados.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capturarends.PNG" style="width: 681px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/109018i3B8C0DF736159C59/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capturarends.PNG" alt="Capturarends.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 15:02:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Creating-a-new-dynamic-column-in-the-script/m-p/2079493#M88556</guid>
      <dc:creator>pinheirf</dc:creator>
      <dc:date>2023-06-02T15:02:46Z</dc:date>
    </item>
  </channel>
</rss>

