<?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: so simple calendar, but how to do date syntax in load in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/so-simple-calendar-but-how-to-do-date-syntax-in-load/m-p/2109942#M90659</link>
    <description>&lt;P&gt;I would use another approach with something like this:&lt;/P&gt;
&lt;P&gt;load *, applymap('MyMap', RecNo) as Flag;&lt;BR /&gt;load date(today() - recno()) as Date, recno() as RecNo autogenerate 60:&lt;/P&gt;
&lt;P&gt;Instead of an appropriate mapping-table which could be easily created in seconds In Excel you may remain by multiple and/or nested if-loops.&lt;/P&gt;
&lt;P&gt;Further I would tend to apply everything within a single flag-field because it would be much easier to handle within the UI. At first it looked impossible because of the each other overlapping periods but it's not too hard by using&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Design/The-As-Of-Table/ba-p/1466130" target="_blank"&gt;(1) The As-Of Table - Qlik Community - 1466130&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Aug 2023 13:59:29 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2023-08-25T13:59:29Z</dc:date>
    <item>
      <title>so simple calendar, but how to do date syntax in load</title>
      <link>https://community.qlik.com/t5/App-Development/so-simple-calendar-but-how-to-do-date-syntax-in-load/m-p/2109710#M90630</link>
      <description>&lt;P&gt;What is wrong here? I have spent hours of trial and error and no closer to what must be a very simple solution that involves correct use of date format and $ expansion.&lt;/P&gt;
&lt;P&gt;FOR i = 1 to 60&lt;BR /&gt;let vDate = Date(today() - i);&lt;BR /&gt;let v4w = if(i&amp;lt;=28,'Y','');&lt;/P&gt;
&lt;P&gt;TRACE $(i) - last4w - $(=if(i&amp;lt;=28,'Y'));&lt;BR /&gt;TRACE test expression is $(v4w);&lt;/P&gt;
&lt;P&gt;Calendar:&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;CensusDate, Last2m?, Last4w?, Last7d?, Last1d?&lt;BR /&gt;$(vDate), Y, $(=if(i&amp;lt;=28,'Y')),$(=if(i&amp;lt;=7,'Y')),$(=if(i=1,'Y))&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;NEXT i;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 22:09:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/so-simple-calendar-but-how-to-do-date-syntax-in-load/m-p/2109710#M90630</guid>
      <dc:creator>daveatkins</dc:creator>
      <dc:date>2023-08-24T22:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: so simple calendar, but how to do date syntax in load</title>
      <link>https://community.qlik.com/t5/App-Development/so-simple-calendar-but-how-to-do-date-syntax-in-load/m-p/2109715#M90631</link>
      <description>&lt;P&gt;sometimes posting the question leads you to the answer: double-interpolation. This accomplishes the desired task:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FOR i = 1 to 60&lt;BR /&gt;let vDate = Date(today() - i);&lt;BR /&gt;let v4w = if($(i)&amp;lt;=28,'Y','');&lt;BR /&gt;let v7d = if($(i)&amp;lt;=7,'Y','');&lt;BR /&gt;let v1d = if($(i)=1,'Y','');&lt;/P&gt;
&lt;P&gt;Calendar:&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;CensusDate, Last2m?, Last4w?, Last7d?, Last1d?&lt;BR /&gt;$(vDate), Y, $(v4w),$(v7d),$(v1d)&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;NEXT i;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 22:48:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/so-simple-calendar-but-how-to-do-date-syntax-in-load/m-p/2109715#M90631</guid>
      <dc:creator>daveatkins</dc:creator>
      <dc:date>2023-08-24T22:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: so simple calendar, but how to do date syntax in load</title>
      <link>https://community.qlik.com/t5/App-Development/so-simple-calendar-but-how-to-do-date-syntax-in-load/m-p/2109942#M90659</link>
      <description>&lt;P&gt;I would use another approach with something like this:&lt;/P&gt;
&lt;P&gt;load *, applymap('MyMap', RecNo) as Flag;&lt;BR /&gt;load date(today() - recno()) as Date, recno() as RecNo autogenerate 60:&lt;/P&gt;
&lt;P&gt;Instead of an appropriate mapping-table which could be easily created in seconds In Excel you may remain by multiple and/or nested if-loops.&lt;/P&gt;
&lt;P&gt;Further I would tend to apply everything within a single flag-field because it would be much easier to handle within the UI. At first it looked impossible because of the each other overlapping periods but it's not too hard by using&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Design/The-As-Of-Table/ba-p/1466130" target="_blank"&gt;(1) The As-Of Table - Qlik Community - 1466130&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 13:59:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/so-simple-calendar-but-how-to-do-date-syntax-in-load/m-p/2109942#M90659</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-08-25T13:59:29Z</dc:date>
    </item>
  </channel>
</rss>

