<?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: Large loop with subroutines and more loops inside ... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696783#M671967</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Colin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then I'm confident that I'm on a good way.&lt;/P&gt;&lt;P&gt;I am already numbering my tabs, but only in 01 (n times) and 02 (n times) and so on to make it clear which tabs have to go first and which ones build on the code in the 01_tabs.&lt;/P&gt;&lt;P&gt;Also, I have settled for putting both my subroutines first and then just the two calling_routines (they must be separate as each of them might or might not be needed).&lt;/P&gt;&lt;P&gt;However, there is a piece of code that has to be outside the two subroutines, so there's one more tab - maybe I can put that code together with the two calling_loops on one tab inside a big loop.&lt;/P&gt;&lt;P&gt;Thanks guys! I guess I'll find a way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Oct 2014 10:00:01 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2014-10-10T10:00:01Z</dc:date>
    <item>
      <title>Large loop with subroutines and more loops inside ...</title>
      <link>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696778#M671962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question rgd. how to keep this orderly:&lt;/P&gt;&lt;P&gt;- I have a code containing two subroutines, which are called a number of times when parsing a list in Excel.&lt;/P&gt;&lt;P&gt;=&amp;gt; Could I put both sheets (I like to separate stuff, so there's one sheet for each of those subroutines) before the actual start of the processing?&lt;/P&gt;&lt;P&gt;=&amp;gt; That would help in keeping all the code halfway orderly because both subroutines are needed to clean the data from one worksheet and the Excel_file that is the root of all evil here has six worksheets - so I need to put the whole thing into one meta_loop with six iterations.&lt;/P&gt;&lt;P&gt;Any other suggestions for keeping it tidy and legible by non-techies are welcome as well.&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 20:01:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696778#M671962</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-10-09T20:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Large loop with subroutines and more loops inside ...</title>
      <link>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696779#M671963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could use a for each loop like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each worksheet in 'sheet1', 'sheet2', ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call ...&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 22:07:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696779#M671963</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-10-09T22:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Large loop with subroutines and more loops inside ...</title>
      <link>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696780#M671964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes, of course - but the syntax is not my issue.&lt;/P&gt;&lt;P&gt;My concern is keeping it all halfway orderly and legible. I always split my script into one tab for every distinct workstep. So if I do a meta_loop around it all like this, the start and end of that loop will be a few tabs distant from one another.&lt;/P&gt;&lt;P&gt;Well, I guess that can't be helped then. I'll just insert comments in the script to make it clearer.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 06:01:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696780#M671964</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-10-10T06:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Large loop with subroutines and more loops inside ...</title>
      <link>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696781#M671965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A good programming practice is to slim down your main loop to something short and understandable. If you can split the body of your main loop in different steps, and those steps are organized on different tabs, convert each tab into a &lt;SPAN style="font-family: 'courier new', courier;"&gt;SUB&lt;/SPAN&gt; with a descriptive name, and your main loop (at the end) will become something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// Begin execution&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;CALL Initialize;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // tab 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FOR this and that&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; CALL SetupWorksheet;&amp;nbsp;&amp;nbsp; // tab 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; CALL Process;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // tab 4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; CALL Aggregate;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // tab 5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; CALL Finalize;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // tab 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NEXT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;CALL ExportAllResidentData; // tab 7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;EXIT Script;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This structure allows you to provide explanations about the program logic in the right places &lt;/P&gt;&lt;P&gt;Another advantage is that in this way, you can hide the details of your SUBs in hidden sheets, while the main control - configuration - step logic remains visible and easy-to-change on the unhidden MAiN sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 09:44:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696781#M671965</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-10-10T09:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Large loop with subroutines and more loops inside ...</title>
      <link>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696782#M671966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can split a loop across multiple tabs without a problem.&lt;/P&gt;&lt;P&gt;When I do that I add a number prefix to my tabs to identify the tab grouping.&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;1-Main&lt;/P&gt;&lt;P&gt;1-mapping tables&lt;/P&gt;&lt;P&gt;2-Loop starts&lt;/P&gt;&lt;P&gt;3-load xxx&lt;/P&gt;&lt;P&gt;3-load yyy&lt;/P&gt;&lt;P&gt;3-load zzz&lt;/P&gt;&lt;P&gt;4-loop ends&lt;/P&gt;&lt;P&gt;5-other script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This means that I can promote and demote the order of tabs in the same section without any problems, but it becomes clear if a tab is moved out of the section by accident. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter's suggestion of separate sub-procedures is an even neater solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 09:53:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696782#M671966</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2014-10-10T09:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Large loop with subroutines and more loops inside ...</title>
      <link>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696783#M671967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Colin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then I'm confident that I'm on a good way.&lt;/P&gt;&lt;P&gt;I am already numbering my tabs, but only in 01 (n times) and 02 (n times) and so on to make it clear which tabs have to go first and which ones build on the code in the 01_tabs.&lt;/P&gt;&lt;P&gt;Also, I have settled for putting both my subroutines first and then just the two calling_routines (they must be separate as each of them might or might not be needed).&lt;/P&gt;&lt;P&gt;However, there is a piece of code that has to be outside the two subroutines, so there's one more tab - maybe I can put that code together with the two calling_loops on one tab inside a big loop.&lt;/P&gt;&lt;P&gt;Thanks guys! I guess I'll find a way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 10:00:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Large-loop-with-subroutines-and-more-loops-inside/m-p/696783#M671967</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-10-10T10:00:01Z</dc:date>
    </item>
  </channel>
</rss>

