<?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 to add a date field multiple times question in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Loop-to-add-a-date-field-multiple-times-question/m-p/1839259#M69421</link>
    <description>&lt;P&gt;Thanks for the helpful answer Marcus&lt;/P&gt;</description>
    <pubDate>Mon, 27 Sep 2021 00:48:42 GMT</pubDate>
    <dc:creator>alexis</dc:creator>
    <dc:date>2021-09-27T00:48:42Z</dc:date>
    <item>
      <title>Loop to add a date field multiple times question</title>
      <link>https://community.qlik.com/t5/App-Development/Loop-to-add-a-date-field-multiple-times-question/m-p/1839128#M69403</link>
      <description>&lt;P&gt;Let us assume that I have a simple table called MyData 10 rows (say) and 2 fields:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;MyData&lt;/STRONG&gt;:&amp;nbsp; // let's say I have 10 rows&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;Load MyField1, MyField2&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;From SomeTable;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and a &lt;STRONG&gt;MasterCalendar&lt;/STRONG&gt;&amp;nbsp;table that contains the fields:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;CalDate&lt;/STRONG&gt;,&amp;nbsp; &amp;nbsp; &amp;nbsp; // date field (1/1/2020)&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;numCalDate&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; // numeric representation of date (e.g. 43831)&lt;/FONT&gt;&lt;BR /&gt;for a period spanning say 1/1/2020 until today (appx 600 records) - I have the date start and end dates stored in variable &lt;EM&gt;vMinDate&lt;/EM&gt; and &lt;EM&gt;vMaxDate&amp;nbsp;&lt;/EM&gt; in numeric format&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to expand the &lt;STRONG&gt;MyData&lt;/STRONG&gt; table so that for every one of the 10 records (say),&amp;nbsp; we append a date field (let's call it &lt;STRONG&gt;MyDate&lt;/STRONG&gt;) for every single date. In other words at the end of the exercise I would end up with a MyData file that will be 6000 records long (10 records x 600&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;different dates) - what is the most efficient way of doing this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If it's easier, you can ignore the MasterCalendar and provide an approach using AutoGenerate to generate the dates with something like:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LOAD $(vMinDate) +RecNo() -1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;AUTOGENERATE ($(vMaxDate) - $(vMinDate) + 1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 20:59:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Loop-to-add-a-date-field-multiple-times-question/m-p/1839128#M69403</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2021-09-24T20:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Loop to add a date field multiple times question</title>
      <link>https://community.qlik.com/t5/App-Development/Loop-to-add-a-date-field-multiple-times-question/m-p/1839148#M69407</link>
      <description>&lt;P&gt;You don't need a loop for it else you could just join the tables without a common key-field to get the cartesian product.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Sat, 25 Sep 2021 08:53:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Loop-to-add-a-date-field-multiple-times-question/m-p/1839148#M69407</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-09-25T08:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Loop to add a date field multiple times question</title>
      <link>https://community.qlik.com/t5/App-Development/Loop-to-add-a-date-field-multiple-times-question/m-p/1839150#M69408</link>
      <description>&lt;P&gt;As &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp; is saying. No need for a loop. Just perform a join like this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;MyData&lt;/STRONG&gt;:&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;Load MyField1, MyField2&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;From SomeTable;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;Join (MyData) Load &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;CalDate,&amp;nbsp; &amp;nbsp; &amp;nbsp; // date field &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;numCalDate&amp;nbsp; &amp;nbsp; // numeric&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;From YourMasterCalendar;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Sep 2021 13:59:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Loop-to-add-a-date-field-multiple-times-question/m-p/1839150#M69408</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2021-09-25T13:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Loop to add a date field multiple times question</title>
      <link>https://community.qlik.com/t5/App-Development/Loop-to-add-a-date-field-multiple-times-question/m-p/1839259#M69421</link>
      <description>&lt;P&gt;Thanks for the helpful answer Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 00:48:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Loop-to-add-a-date-field-multiple-times-question/m-p/1839259#M69421</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2021-09-27T00:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Loop to add a date field multiple times question</title>
      <link>https://community.qlik.com/t5/App-Development/Loop-to-add-a-date-field-multiple-times-question/m-p/1839260#M69422</link>
      <description>&lt;P&gt;Thanks Vegar&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 00:49:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Loop-to-add-a-date-field-multiple-times-question/m-p/1839260#M69422</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2021-09-27T00:49:22Z</dc:date>
    </item>
  </channel>
</rss>

