<?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 Generate 20 weeks in calendar in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Generate-20-weeks-in-calendar/m-p/2059152#M86952</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I'm trying to generate a calendar but I want this calendar to only generate 20 weeks for me instead of 104 weeks.&lt;/P&gt;
&lt;P&gt;What's the best way to do it? This is the variable&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;v_date_end_calendrier&lt;/FONT&gt; :&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LET v_date_start_calendar = YearStart(AddYears(today(), -1));&lt;/P&gt;
&lt;P&gt;LET &lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;v_date_end_calendrier&lt;/FONT&gt; &lt;/STRONG&gt;=YearEnd(today());&lt;/P&gt;
&lt;P&gt;LET v_nb_week_calendar = round((v_date_end_calendrier - v_date_start_calendar) / 7);&lt;/P&gt;
&lt;P&gt;LET v_date_start_calendar_week = WeekStart(Today() - 7 * (v_nb_week_calendar-1));&lt;/P&gt;
&lt;P&gt;LET v_nb_month_calendrier = Num(((year(Today())*12)+month(Today()))-((year(v_date_start_calendar)*12)+month(v_date_start_calendar))+1);&lt;/P&gt;
&lt;P&gt;LET v_date_start_calendrier_mois = MonthStart(Today(), - v_nb_month_calendrier + 1);&lt;/P&gt;</description>
    <pubDate>Tue, 11 Apr 2023 13:38:08 GMT</pubDate>
    <dc:creator>jmialoundama</dc:creator>
    <dc:date>2023-04-11T13:38:08Z</dc:date>
    <item>
      <title>Generate 20 weeks in calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-20-weeks-in-calendar/m-p/2059152#M86952</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I'm trying to generate a calendar but I want this calendar to only generate 20 weeks for me instead of 104 weeks.&lt;/P&gt;
&lt;P&gt;What's the best way to do it? This is the variable&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;v_date_end_calendrier&lt;/FONT&gt; :&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LET v_date_start_calendar = YearStart(AddYears(today(), -1));&lt;/P&gt;
&lt;P&gt;LET &lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;v_date_end_calendrier&lt;/FONT&gt; &lt;/STRONG&gt;=YearEnd(today());&lt;/P&gt;
&lt;P&gt;LET v_nb_week_calendar = round((v_date_end_calendrier - v_date_start_calendar) / 7);&lt;/P&gt;
&lt;P&gt;LET v_date_start_calendar_week = WeekStart(Today() - 7 * (v_nb_week_calendar-1));&lt;/P&gt;
&lt;P&gt;LET v_nb_month_calendrier = Num(((year(Today())*12)+month(Today()))-((year(v_date_start_calendar)*12)+month(v_date_start_calendar))+1);&lt;/P&gt;
&lt;P&gt;LET v_date_start_calendrier_mois = MonthStart(Today(), - v_nb_month_calendrier + 1);&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 13:38:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-20-weeks-in-calendar/m-p/2059152#M86952</guid>
      <dc:creator>jmialoundama</dc:creator>
      <dc:date>2023-04-11T13:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Generate 20 weeks in calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-20-weeks-in-calendar/m-p/2064984#M87354</link>
      <description>&lt;P&gt;you can use the iterno() function to generate numbers and from there play around with the dates.&amp;nbsp; its hard to understand your variables but whats really needed is a reference point like when does your calendar end or start.&amp;nbsp; this example works backwards starting from the current full week (today being 4/26, it ends at the end of the week 4/29) and goes back 4 weeks:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;load 
	date(WeekEnd(today())-iterno()+1) as date
while 
	date(WeekEnd(today())-iterno()+1) &amp;lt;= WeekEnd(today()) 
	and date(WeekEnd(today())-iterno()+1)&amp;gt;date(WeekEnd(today())-(7*4));
load  1 AutoGenerate(1);&lt;/LI-CODE&gt;
&lt;P&gt;the number of weeks is specified in the last phrase of the where clause 7*4 so substitute that with 7*20&lt;BR /&gt;&lt;BR /&gt;the idea is iterrate through numbers from 1 to n while the calculated date is between the end of this week and back the end of this week - 7 days * number of weeks&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 18:43:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-20-weeks-in-calendar/m-p/2064984#M87354</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2023-04-26T18:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Generate 20 weeks in calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-20-weeks-in-calendar/m-p/2065410#M87392</link>
      <description>&lt;P&gt;You can modify the calculation of v_nb_week_calendar to limit the number of weeks to 20 instead of the total number of weeks between the start and end dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an updated script that sets v_nb_week_calendar to 20 weeks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LET v_date_start_calendar = YearStart(AddYears(today(), -1));&lt;/P&gt;
&lt;P&gt;LET v_date_end_calendrier =YearEnd(today());&lt;/P&gt;
&lt;P&gt;LET v_nb_week_calendar = 20; // Set the number of weeks to 20&lt;/P&gt;
&lt;P&gt;LET v_date_start_calendar_week = WeekStart(Today() - 7 * (v_nb_week_calendar-1));&lt;/P&gt;
&lt;P&gt;LET v_nb_month_calendrier = Num(((year(Today())*12)+month(Today()))-((year(v_date_start_calendar)*12)+month(v_date_start_calendar))+1);&lt;/P&gt;
&lt;P&gt;LET v_date_start_calendrier_mois = MonthStart(Today(), - v_nb_month_calendrier + 1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 17:45:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-20-weeks-in-calendar/m-p/2065410#M87392</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2023-04-27T17:45:56Z</dc:date>
    </item>
  </channel>
</rss>

