<?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 How to create a table based on data from an existing table in script part 2 in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-create-a-table-based-on-data-from-an-existing-table-in/m-p/1349017#M29976</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a similar but for me more challenging question on how to create a table based on some field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I need:&lt;/P&gt;&lt;P&gt;There is an record in an existing table with ID=A, start Date=May, Months=36 and Value =360.&lt;/P&gt;&lt;P&gt;Based on this I would like to create a new table which splits the value into 12 months lines. The close date for each new line needs to be a date in the month preceding the start month. In the example below I took the 25th of the month before.&lt;/P&gt;&lt;P&gt;The line for the first 12 months I already have calculated **, so ideally there is no need anymore to create the Italic lines in grey you see in the "To Be Created" table. But if it's easier, then I'm fine if they are created as I guess I am able to remove the duplicates in some way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope my challenge is clear ?&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/170953_pastedImage_2.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;** if months &amp;gt; 12 then Value = 12 * (value/months). &amp;amp; Close date is in reality also a field on the existing table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Jul 2017 06:24:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-07-21T06:24:57Z</dc:date>
    <item>
      <title>How to create a table based on data from an existing table in script part 2</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-create-a-table-based-on-data-from-an-existing-table-in/m-p/1349017#M29976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a similar but for me more challenging question on how to create a table based on some field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I need:&lt;/P&gt;&lt;P&gt;There is an record in an existing table with ID=A, start Date=May, Months=36 and Value =360.&lt;/P&gt;&lt;P&gt;Based on this I would like to create a new table which splits the value into 12 months lines. The close date for each new line needs to be a date in the month preceding the start month. In the example below I took the 25th of the month before.&lt;/P&gt;&lt;P&gt;The line for the first 12 months I already have calculated **, so ideally there is no need anymore to create the Italic lines in grey you see in the "To Be Created" table. But if it's easier, then I'm fine if they are created as I guess I am able to remove the duplicates in some way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope my challenge is clear ?&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/170953_pastedImage_2.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;** if months &amp;gt; 12 then Value = 12 * (value/months). &amp;amp; Close date is in reality also a field on the existing table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2017 06:24:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-create-a-table-based-on-data-from-an-existing-table-in/m-p/1349017#M29976</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-21T06:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table based on data from an existing table in script part 2</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-create-a-table-based-on-data-from-an-existing-table-in/m-p/1349018#M29977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the answer, with help of the previous answer I got and some logical thinking&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TO_BE_CREATED:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt; "ID"&amp;amp;'-'&amp;amp;(IterNo()+1),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddYears("Start Date",IterNo())&amp;nbsp;&amp;nbsp;&amp;nbsp; as "TB Start Date",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(("Months"-12*IterNo())&amp;gt;12,12,"Months-12*IterNo())&amp;nbsp;&amp;nbsp;&amp;nbsp; as "TB Months",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(("Months"-12*IterNo())&amp;gt;12,12*"Value"/"Months",("Months"-12*IterNo())*"Value"/"Months") as "TB Value"&lt;/P&gt;&lt;P&gt;Resident Existing_Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While "Months"-12*(IterNo()-1)&amp;gt;12;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jul 2017 06:25:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-create-a-table-based-on-data-from-an-existing-table-in/m-p/1349018#M29977</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-24T06:25:47Z</dc:date>
    </item>
  </channel>
</rss>

