<?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: Extract all year dates between two dates in a table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Extract-all-year-dates-between-two-dates-in-a-table/m-p/2079471#M88552</link>
    <description>&lt;P&gt;The structure of a Load within a Loop is:&lt;BR /&gt;For ...&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Load ...&lt;BR /&gt;Next&lt;/P&gt;
&lt;P&gt;The structure of a Loop within a Load is:&lt;BR /&gt;Load ...&lt;BR /&gt;&amp;nbsp; &amp;nbsp;From ...&lt;BR /&gt;&amp;nbsp; &amp;nbsp;While ...;&lt;/P&gt;
&lt;P&gt;The first blog post addresses both types.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2023 14:10:54 GMT</pubDate>
    <dc:creator>hic</dc:creator>
    <dc:date>2023-06-02T14:10:54Z</dc:date>
    <item>
      <title>Extract all year dates between two dates in a table</title>
      <link>https://community.qlik.com/t5/App-Development/Extract-all-year-dates-between-two-dates-in-a-table/m-p/2079413#M88546</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the following data:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;Article ID&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Price&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Price is valid from&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Price is valid to&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;1&lt;/TD&gt;
&lt;TD height="25px"&gt;3&lt;/TD&gt;
&lt;TD height="25px"&gt;01.01.2019&lt;/TD&gt;
&lt;TD height="25px"&gt;01.06.2019&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;1&lt;/TD&gt;
&lt;TD height="25px"&gt;4&lt;/TD&gt;
&lt;TD height="25px"&gt;01.07.2019&lt;/TD&gt;
&lt;TD height="25px"&gt;01.12.2019&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;01.12.2019&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;01.01.2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;1&lt;/TD&gt;
&lt;TD height="25px"&gt;5&lt;/TD&gt;
&lt;TD height="25px"&gt;01.01.2021&lt;/TD&gt;
&lt;TD height="25px"&gt;01.01.2022&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I want to create a table with the following content:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%" height="29px"&gt;Article ID&lt;/TD&gt;
&lt;TD width="20%" height="29px"&gt;Avg-Price in 2022&lt;/TD&gt;
&lt;TD width="20%" height="29px"&gt;Avg-Price in 2021&lt;/TD&gt;
&lt;TD width="20%" height="29px"&gt;Avg-Prive in 2020&lt;/TD&gt;
&lt;TD width="20%" height="29px"&gt;Avg-Price in 2019&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is, I have years which are not mentioned in the data. In this case, for instance, year 2020 is not mentioned in the data, but has the price "2", because of "01.12.2019 to 01.01.2021". How can I solve this problem?&lt;/P&gt;
&lt;P&gt;Is there a way to "split" each row in the data-table into multiple rows by containing year in the "valid from to valid to"-range?&lt;/P&gt;
&lt;P&gt;For Example, lets look at row 3 in data-table:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;Article ID&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Price&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Price is valid from&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Price is valid to&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;01.12.2019&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;01.01.2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to "split" this row in 3 different row, because this price is valid for 3 years:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;Article ID&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Price&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Price is valid from&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Price is valid to&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;year&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="27px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="27px"&gt;2&lt;/TD&gt;
&lt;TD width="20%" height="27px"&gt;01.12.2019&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;01.01.2021&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2019&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;01.12.2019&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;01.01.2021&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;01.12.2019&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;01.01.2021&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now i could calculate the avg price for all years because I have all relevant years in the new column "year"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can someone please help me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 13:52:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extract-all-year-dates-between-two-dates-in-a-table/m-p/2079413#M88546</guid>
      <dc:creator>fatihu</dc:creator>
      <dc:date>2023-06-02T13:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extract all year dates between two dates in a table</title>
      <link>https://community.qlik.com/t5/App-Development/Extract-all-year-dates-between-two-dates-in-a-table/m-p/2079449#M88550</link>
      <description>&lt;P&gt;A "While" clause will do what you want. See &lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Design/Loops-in-the-Script/ba-p/1473543" target="_blank"&gt;https://community.qlik.com/t5/Design/Loops-in-the-Script/ba-p/1473543&lt;/A&gt;&lt;BR /&gt;or &lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Design/Creating-Reference-Dates-for-Intervals/ba-p/1463944" target="_blank"&gt;https://community.qlik.com/t5/Design/Creating-Reference-Dates-for-Intervals/ba-p/1463944&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 13:28:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extract-all-year-dates-between-two-dates-in-a-table/m-p/2079449#M88550</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2023-06-02T13:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Extract all year dates between two dates in a table</title>
      <link>https://community.qlik.com/t5/App-Development/Extract-all-year-dates-between-two-dates-in-a-table/m-p/2079460#M88551</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see, that I can use a LOAD statement within a LOOP.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But how can I use a LOOP within a LOAD statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my example mentioned above we have row number 3 (table 1) which results in 3 new rows (table 4), because the columns from - to are 2019 to 2021, which means I need the row with each 2019, 2020 and 2021.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am still confused as a beginner.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 13:56:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extract-all-year-dates-between-two-dates-in-a-table/m-p/2079460#M88551</guid>
      <dc:creator>fatihu</dc:creator>
      <dc:date>2023-06-02T13:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extract all year dates between two dates in a table</title>
      <link>https://community.qlik.com/t5/App-Development/Extract-all-year-dates-between-two-dates-in-a-table/m-p/2079471#M88552</link>
      <description>&lt;P&gt;The structure of a Load within a Loop is:&lt;BR /&gt;For ...&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Load ...&lt;BR /&gt;Next&lt;/P&gt;
&lt;P&gt;The structure of a Loop within a Load is:&lt;BR /&gt;Load ...&lt;BR /&gt;&amp;nbsp; &amp;nbsp;From ...&lt;BR /&gt;&amp;nbsp; &amp;nbsp;While ...;&lt;/P&gt;
&lt;P&gt;The first blog post addresses both types.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 14:10:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extract-all-year-dates-between-two-dates-in-a-table/m-p/2079471#M88552</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2023-06-02T14:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Extract all year dates between two dates in a table</title>
      <link>https://community.qlik.com/t5/App-Development/Extract-all-year-dates-between-two-dates-in-a-table/m-p/2079599#M88566</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/210907"&gt;@fatihu&lt;/a&gt;&amp;nbsp; try below&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Load [Article ID],
     Price,
     Price_Valid_From,
     Price_Valid_To,
     Year(Price_Valid_From)+IterNo()-1 as Price_Valid_Year
FROM Source
while Year(Price_Valid_From)+IterNo()-1&amp;lt;=year(Price_Valid_To);&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Jun 2023 22:51:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extract-all-year-dates-between-two-dates-in-a-table/m-p/2079599#M88566</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2023-06-02T22:51:03Z</dc:date>
    </item>
  </channel>
</rss>

