<?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 Question about recursive use of left function. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Question-about-recursive-use-of-left-function/m-p/208233#M63668</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the lenftgh of all values is the same, the next script can be used (or similar to this):&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Cuentas_Mayor7: // this is just for illustration&lt;BR /&gt;load * inline [&lt;BR /&gt; N, N2&lt;BR /&gt; 10, 6030001&lt;BR /&gt; 10, 6030002];&lt;BR /&gt;&lt;BR /&gt;// Example starts here&lt;BR /&gt;LET L = len(peek('N2')); // define length&lt;BR /&gt;//&lt;BR /&gt;NOCONCATENATE&lt;BR /&gt;Cuentas_Mayor8:&lt;BR /&gt;LOAD&lt;BR /&gt; N,&lt;BR /&gt; N2&lt;BR /&gt;resident Cuentas_Mayor7;&lt;BR /&gt;//&lt;BR /&gt;for l = 1 to $(L)&lt;BR /&gt; JOIN (Cuentas_Mayor8) LOAD&lt;BR /&gt; N,&lt;BR /&gt; N2,&lt;BR /&gt; left(N2,$(l)) as IDCuentaNivel$(l)&lt;BR /&gt; RESIDENT Cuentas_Mayor7;&lt;BR /&gt;next&lt;BR /&gt;//&lt;BR /&gt;DROP TABLE Cuentas_Mayor7;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 19 Sep 2010 17:25:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-09-19T17:25:22Z</dc:date>
    <item>
      <title>Question about recursive use of left function.</title>
      <link>https://community.qlik.com/t5/QlikView/Question-about-recursive-use-of-left-function/m-p/208232#M63667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll show you what I'm trying to do :&lt;/P&gt;&lt;P&gt;This is an image of my desired result :&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="-2393" alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/2393_sourceID:2393" /&gt;&lt;/P&gt;&lt;P&gt;Here you can find the two key fields : N_Fila and N_Fila_Cuenta.&lt;/P&gt;&lt;P&gt;N_Fila_Cuenta is the important one, because I want to divide all the numbers of this field in "levels" like I've shown you before in the picture.&lt;/P&gt;&lt;P&gt;By now, I'm doing it in a static way, wich means I use the left() function to get the desired results because I know exactly that the last level will be level 7.&lt;/P&gt;&lt;P&gt;This is how I'm doin it now :&lt;/P&gt;&lt;P&gt;Cuentas_Mayor8:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load&lt;BR /&gt;N as N_Fila,&lt;BR /&gt;N2 as N_Fila_Cuenta,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left(N2,1) as "IDCuentaNivel1",&lt;BR /&gt;left(N2,2) as "IDCuentaNivel2",&lt;BR /&gt;left(N2,3) as "IDCuentaNivel3",&lt;BR /&gt;left(N2,4) as "IDCuentaNivel4",&lt;BR /&gt;left(N2,5) as "IDCuentaNivel5",&lt;BR /&gt;left(N2,6) as "IDCuentaNivel6",&lt;BR /&gt;left(N2,7) as "IDCuentaNivel7"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resident Cuentas_Mayor7;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in the future I won't know how many numbers will have the field "N_Fila_Cuenta", which means I won't know how many levels I'll have.&lt;/P&gt;&lt;P&gt;Anybody has an idea how to that in a dynamic way? I appreciate any kind of help.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Sep 2010 16:31:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-about-recursive-use-of-left-function/m-p/208232#M63667</guid>
      <dc:creator>marcel_olmo</dc:creator>
      <dc:date>2010-09-19T16:31:29Z</dc:date>
    </item>
    <item>
      <title>Question about recursive use of left function.</title>
      <link>https://community.qlik.com/t5/QlikView/Question-about-recursive-use-of-left-function/m-p/208233#M63668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the lenftgh of all values is the same, the next script can be used (or similar to this):&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Cuentas_Mayor7: // this is just for illustration&lt;BR /&gt;load * inline [&lt;BR /&gt; N, N2&lt;BR /&gt; 10, 6030001&lt;BR /&gt; 10, 6030002];&lt;BR /&gt;&lt;BR /&gt;// Example starts here&lt;BR /&gt;LET L = len(peek('N2')); // define length&lt;BR /&gt;//&lt;BR /&gt;NOCONCATENATE&lt;BR /&gt;Cuentas_Mayor8:&lt;BR /&gt;LOAD&lt;BR /&gt; N,&lt;BR /&gt; N2&lt;BR /&gt;resident Cuentas_Mayor7;&lt;BR /&gt;//&lt;BR /&gt;for l = 1 to $(L)&lt;BR /&gt; JOIN (Cuentas_Mayor8) LOAD&lt;BR /&gt; N,&lt;BR /&gt; N2,&lt;BR /&gt; left(N2,$(l)) as IDCuentaNivel$(l)&lt;BR /&gt; RESIDENT Cuentas_Mayor7;&lt;BR /&gt;next&lt;BR /&gt;//&lt;BR /&gt;DROP TABLE Cuentas_Mayor7;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Sep 2010 17:25:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-about-recursive-use-of-left-function/m-p/208233#M63668</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-09-19T17:25:22Z</dc:date>
    </item>
    <item>
      <title>Question about recursive use of left function.</title>
      <link>https://community.qlik.com/t5/QlikView/Question-about-recursive-use-of-left-function/m-p/208234#M63669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael. Your post was very helpful.&lt;/P&gt;&lt;P&gt;I didn't know that you can loop a recently loaded table like this.&lt;/P&gt;&lt;P&gt;That was exactly what I was looking for.&lt;/P&gt;&lt;P&gt;Thank you and see you around!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Sep 2010 21:02:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-about-recursive-use-of-left-function/m-p/208234#M63669</guid>
      <dc:creator>marcel_olmo</dc:creator>
      <dc:date>2010-09-19T21:02:28Z</dc:date>
    </item>
  </channel>
</rss>

