<?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: Loop for Field name in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193437#M385300</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can provide a sample of data, we can play around with it to make it work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Oct 2016 17:15:44 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-10-12T17:15:44Z</dc:date>
    <item>
      <title>Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193434#M385297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking to create a dynamic label based on a field from one of my tables in the script. I have this field [AccountFriendlyName] that is potentially very lengthy. My goal is to create a new field that I can use that is formatted nicer than the original field. I think I am close with my loop but I seem to have an issue with defining a variable to a field name outside of a load. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vNumOfSpaces = SubStringCount(AccountFriendlyName,' ');&lt;/P&gt;&lt;P&gt;Set vLabelAccountName = '';&lt;/P&gt;&lt;P&gt;Set i = 0;&lt;/P&gt;&lt;P&gt;Set vLastPosition = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do While i &amp;lt; $(vNumOfSpaces) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vIndex = Index(AccountFriendlyName,' ',$(i)) - $(vLastPosition);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If $(vIndex) &amp;lt; 12 then&lt;/P&gt;&lt;P&gt;&amp;nbsp; Trace $(vIndex);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Next i;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ELSEIF $(vIndex) &amp;gt; 12 then&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vLabel_AccountName =&amp;nbsp; $(vLabel_AccountName) &amp;amp; Mid(AccountFriendlyName,$(vLastPosition),$(vIndex)) &amp;amp; Chr(13);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set vLastPosition = $(vIndex);&lt;/P&gt;&lt;P&gt;&amp;nbsp; TRACE $(vIndex) &amp;amp; '_' &amp;amp; $(vLastPosition);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Next i;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;Loop;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 15:07:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193434#M385297</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2016-10-12T15:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193435#M385298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See if this helps you. One of my colleague created this and I thought it was pretty impressive. See if this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 16:26:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193435#M385298</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-12T16:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193436#M385299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick reply. I can see where you colleague was going with this but I am looking for something a little more dynamic. They hard-coded each substringcount command up until 7. In my case I know I have some fields that go up to 12 but I really want to explore this using variables and a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this method could work, but it is not ideal for my situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 17:13:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193436#M385299</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2016-10-12T17:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193437#M385300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can provide a sample of data, we can play around with it to make it work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 17:15:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193437#M385300</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-12T17:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193438#M385301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately I cant share the data I am using for AccountFriendlyName. But you can create your own sample data for this one field pretty easily. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I have some fields that have no spaces and others that have any number of spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I listed my loop code so that should get you started.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 17:42:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193438#M385301</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2016-10-12T17:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193439#M385302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I might create dummy data which won't work for you, if you can provide dummy data which is close to your data we won't have to go through the pain of re-doing this multiple times &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 17:48:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193439#M385302</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-12T17:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193440#M385303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a file you can use. Again the words dont matter (these arent even english) but you get the idea.&lt;/P&gt;&lt;P&gt;(Not sure why I couldnt attach this, but consider each row 1 record).&lt;/P&gt;&lt;P&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="547"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="547"&gt;AccountFriendlyName&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;sem magna nec quam.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;tristique senectus et netus et malesuada fames ac&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Phasellus elit&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;inceptos hymenaeos. Mauris ut quam vel sapien imperdiet ornare. In faucibus. Morbi&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;lacus, varius et, euismod et, commodo at, libero. Morbi accumsan&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;et, rutrum eu,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Donec nibh enim, gravida sit amet, dapibus id, blandit at, nisi. Cum&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;eu neque&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;est, mollis non, cursus non, egestas a, dui. Cras pellentesque. Sed&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;velit in aliquet lobortis, nisi nibh lacinia orci,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;lorem. Donec elementum, lorem ut aliquam iaculis, lacus pede sagittis&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;in, tempus eu, ligula. Aenean euismod mauris eu elit. Nulla facilisi.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;feugiat. Lorem ipsum dolor sit amet, consectetuer adipiscing&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;neque vitae semper egestas, urna justo faucibus lectus, a sollicitudin&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Phasellus ornare. Fusce mollis. Duis sit amet diam eu dolor egestas&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;nisl arcu iaculis enim, sit&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;et pede. Nunc sed orci lobortis augue scelerisque mollis.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Curabitur consequat, lectus sit amet luctus vulputate, nisi sem semper&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;mi eleifend egestas. Sed pharetra, felis eget varius ultrices,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;mauris&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;velit. Pellentesque&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;neque. In ornare sagittis felis. Donec tempor, est ac mattis semper, dui&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;eu erat semper rutrum. Fusce dolor quam, elementum&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;malesuada vel, venenatis vel, faucibus id, libero. Donec consectetuer mauris&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;odio tristique pharetra. Quisque ac libero&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;non, lacinia at, iaculis quis, pede. Praesent&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;ac mattis semper,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;lectus pede et&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;nisl elementum purus, accumsan&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;erat&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;tincidunt,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Curabitur&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;ligula elit, pretium et, rutrum non, hendrerit id, ante.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;ridiculus mus. Proin vel nisl. Quisque fringilla euismod&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;pellentesque, tellus sem mollis&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;libero lacus, varius et, euismod et,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;nec urna et arcu imperdiet&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;id, mollis nec, cursus a, enim. Suspendisse aliquet,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;nunc id enim. Curabitur massa.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;eu erat semper rutrum. Fusce dolor quam, elementum at, egestas a,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;egestas rhoncus. Proin nisl sem, consequat nec, mollis vitae, posuere at,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;a, scelerisque sed, sapien. Nunc pulvinar arcu et pede. Nunc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;non magna. Nam ligula&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;libero et tristique pellentesque,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;dapibus ligula. Aliquam erat volutpat.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;magnis dis parturient montes, nascetur ridiculus mus. Proin vel nisl.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;urna et arcu imperdiet ullamcorper. Duis at lacus. Quisque&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;augue. Sed molestie. Sed id risus quis&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;id, mollis nec,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;a, enim.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Nunc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;pede ac urna. Ut tincidunt vehicula risus. Nulla eget metus&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;tincidunt adipiscing.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;odio. Aliquam vulputate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;eu, ultrices&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Nunc ut erat. Sed nunc est, mollis non, cursus&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;nunc,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;risus. Duis a mi fringilla&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;mi tempor lorem, eget mollis lectus pede&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;euismod et, commodo at, libero. Morbi accumsan laoreet ipsum.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Quisque porttitor eros nec tellus. Nunc lectus pede, ultrices a, auctor non,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;lacus. Nulla tincidunt, neque vitae semper egestas,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;consequat auctor, nunc nulla vulputate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Donec elementum, lorem ut aliquam iaculis, lacus pede sagittis&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;diam eu dolor egestas rhoncus. Proin nisl sem, consequat nec,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;magna a tortor. Nunc commodo auctor velit. Aliquam nisl. Nulla&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;amet, consectetuer adipiscing&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;quis turpis vitae purus gravida sagittis. Duis gravida. Praesent eu nulla at&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;orci&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;sit amet luctus vulputate, nisi sem&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;amet ante. Vivamus non lorem vitae odio sagittis semper. Nam tempor diam&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;lacus. Quisque imperdiet, erat nonummy ultricies ornare, elit elit fermentum risus,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;eu&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;vel&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Donec est. Nunc ullamcorper, velit in aliquet lobortis, nisi nibh lacinia orci,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;vitae odio sagittis semper. Nam tempor diam dictum&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;non, bibendum sed, est. Nunc laoreet lectus quis&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;mollis. Duis sit amet diam eu dolor&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Duis at lacus. Quisque purus sapien, gravida non, sollicitudin a, malesuada&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;magna. Ut tincidunt orci quis lectus. Nullam suscipit,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;nec enim. Nunc ut erat. Sed nunc est, mollis non, cursus non,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;nec, mollis vitae, posuere at, velit. Cras lorem lorem,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Aenean gravida nunc sed pede. Cum sociis natoque penatibus et&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;magnis dis parturient montes,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;molestie. Sed id risus quis diam luctus lobortis. Class&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;aliquam iaculis, lacus pede sagittis augue, eu tempor erat neque non quam.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Nam tempor diam dictum sapien. Aenean massa. Integer vitae nibh. Donec&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;magna. Duis dignissim tempor arcu. Vestibulum ut eros non enim commodo&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;nec, mollis&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;sem semper erat, in consectetuer ipsum nunc id enim. Curabitur&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;pellentesque eget, dictum placerat, augue. Sed molestie. Sed id&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;aliquam iaculis, lacus pede sagittis augue, eu tempor erat neque non&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;facilisis&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;semper cursus. Integer mollis. Integer tincidunt aliquam arcu. Aliquam ultrices&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;vel, faucibus id, libero. Donec consectetuer mauris&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;nunc sit amet metus. Aliquam erat volutpat.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Donec porttitor tellus non magna. Nam ligula elit, pretium et, rutrum non,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;ornare. Fusce mollis. Duis sit amet diam eu dolor egestas rhoncus.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;erat. Sed nunc est, mollis non, cursus non, egestas a,&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 19:32:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193440#M385303</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2016-10-12T19:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193441#M385304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did not understand the if statement, but check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD AccountFriendlyName&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2051" data-containertype="14" data-objectid="236104" data-objecttype="1" href="https://community.qlik.com/thread/236104"&gt;https://community.qlik.com/thread/236104&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FOR i = 1 to FieldValueCount('AccountFriendlyName')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; LET vNumOfSpaces = SubStringCount(FieldValue('AccountFriendlyName', $(i)), ' ');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; SET vLabelAccountName = '';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; SET j = 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; SET vLastPosition = 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; vLabel_AccountName$(i) = Null();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; FOR j = 1 to $(vNumOfSpaces)+1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; LET vIndex = Index(FieldValue('AccountFriendlyName', $(i)),' ',$(j));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; LET vLen = Len(FieldValue('AccountFriendlyName', $(i)))+1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; LET vLabel_AccountName$(i) =&amp;nbsp; '$(vLabel_AccountName$(i))' &amp;amp; Trim(Mid(FieldValue('AccountFriendlyName', $(i)),$(vLastPosition),If($(vIndex) = 0, $(vLen), $(vIndex)) -$(vLastPosition))) &amp;amp; Chr(13);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; SET vLastPosition = $(vIndex);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; NEXT j;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NEXT i;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 20:50:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193441#M385304</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-12T20:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193442#M385305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for taking the time to work on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think we are getting closer but still not exactly what I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The If statement was to determine if the length of the word was longer than 12 characters. I dont always want to break the sentence at each space. I want to ensure I can fit as much of the sentence on each line as possible before adding the line break. So if a sentence was "I can climb to the top of the hill", I want it to be stored as&lt;/P&gt;&lt;P&gt;"I can climb &lt;/P&gt;&lt;P&gt;to the top&lt;/P&gt;&lt;P&gt;of the hill"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for the breaks where they are is because I am using "12" as my character limit per row. If that falls in the middle of a word then the line break should occur at the previous space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*I also noticed that you have these being stored as variables for each value. Ideally, I would like this to just be a field within the same table that AccountFriendlyName comes from just with a different name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2016 18:59:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193442#M385305</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2016-10-14T18:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193443#M385306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could imagine that a different approach to split your records and put them together again (with a certain logic) could be easier. Take a look on the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//RawData:&lt;/P&gt;&lt;P&gt;//LOAD AccountFriendlyName&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//FROM [&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2051" data-containertype="14" data-objectid="236104" data-objecttype="1" href="https://community.qlik.com/thread/236104"&gt;https://community.qlik.com/thread/236104&lt;/A&gt;&lt;SPAN&gt;] (html, codepage is 1252, embedded labels, table is @1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;//store RawData into RawData.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RawData:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trim(AccountFriendlyName) as AccountFriendlyName, SubStringCount(trim(AccountFriendlyName), ' ') as NumberOfSpaces,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Len(trim(AccountFriendlyName)) as RecordLength, recno() as RecNo&lt;/P&gt;&lt;P&gt;From RawData.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vNumberOfChars = 12;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SplitRecords:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *, ceil(WordLengthWithSpaceCum / $(vNumberOfChars)) as WordCluster,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RecNo &amp;amp; '|' &amp;amp; ceil(WordLengthWithSpaceCum / $(vNumberOfChars)) as WordKey;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *, len(SingleWord) as WordLength, if(RecNo &amp;lt;&amp;gt; peek('RecNo'), len(SingleWord), len(SingleWord) + peek('WordLengthCum')) as WordLengthCum,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(RecNo &amp;lt;&amp;gt; peek('RecNo'), len(SingleWord), len(SingleWord) + peek('WordLengthCum') + IterNo - 1) as WordLengthWithSpaceCum;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RecNo, iterno() as IterNo, subfield(AccountFriendlyName, ' ', iterno()) as SingleWord&lt;/P&gt;&lt;P&gt;Resident RawData while iterno() &amp;lt;= NumberOfSpaces + 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ConcatWords:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rowno() as RowNo, WordKey, concat(SingleWord, ' ') as ConcatWords&lt;/P&gt;&lt;P&gt;resident SplitRecords group by WordKey;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Oct 2016 13:13:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193443#M385306</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-10-15T13:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193444#M385307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/27943"&gt;marcus_sommer&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for this script. I see what you are doing and I think it is very close to working for my purposes. What I have found is that the returned string (ConcatWords) is not in the correct order. It looks like the way the values are stored in SingleWord doesnt store them in order from each IterNo so when the concat happens the values are out of order. I was thinking about using FirstSortedValue to store the SingleWord in the correct order but wasn't sure exactly how to get it to work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts on how I can make sure the SingleWord field is storing the values in the exact order?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 14:45:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193444#M385307</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2016-10-17T14:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193445#M385308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have not looked at the complete script that Marcus has provided, but Concat() takes a third argument which tells the function to sort in a particular order. May be that is what you need here&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/StringAggregationFunctions/concat.htm" title="https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/StringAggregationFunctions/concat.htm"&gt;https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/StringAggregationFunctions/concat.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 15:03:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193445#M385308</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-17T15:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193446#M385309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here a small adjustment to get the right order within the concat-function which could be sorted:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ConcatWords:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rowno() as RowNo, WordKey, concat(SingleWord, ' ', &lt;STRONG&gt;IterNo&lt;/STRONG&gt;) as ConcatWords&lt;/P&gt;&lt;P&gt;resident SplitRecords group by WordKey;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 15:05:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193446#M385309</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-10-17T15:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193447#M385310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both for your continued help. &lt;SPAN style="font-size: 10pt;"&gt;I can't believe I forgot that concat had a third argument, but thanks for pointing that out.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing that I am not sure I understand is now that this concatenation has occurred, it would appear that each line of text is separate within the ConcatWords field. What I mean by this is that if I try to use ConcatWords as either a label in a bar chart (original goal of my request) or as a list box, I can click on either line of text. I would have expected the text to remain as one clickable object or better one field for my bar chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts as to why this isn't the case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 16:04:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193447#M385310</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2016-10-17T16:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193448#M385311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not quite clear to me what you want to achieve with them. Please share a small example with your objects and maybe a picture of how it should look like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 11:31:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193448#M385311</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-10-18T11:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193449#M385312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a sample QVW.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 12:46:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193449#M385312</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2016-10-18T12:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193450#M385313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The values needs to include linebreaks to achieve such a multi-line displaying. I had made an adjustement of your example with replace(AccountFriendlyName, ' ', chr(10)) and also adjusted my example with a further load to adapt these logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 17:13:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193450#M385313</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-10-18T17:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193451#M385314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the solution I needed here: &lt;A href="https://community.qlik.com/thread/51663"&gt;Displaying long labels on chart X-axis&lt;/A&gt;‌. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I edited Rob's code to better fit my needs since my field "AccountFriendlyName" isnt unique to the dataset. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you to everyone who took the time to work on this problem!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 18:02:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193451#M385314</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2016-10-18T18:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Loop for Field name</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193452#M385315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Marcus again for all your help on this!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 18:03:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-for-Field-name/m-p/1193452#M385315</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2016-10-18T18:03:19Z</dc:date>
    </item>
  </channel>
</rss>

