<?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 calculate Sales for a Promotion Period? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-for-a-Promotion-Period/m-p/1993047#M82175</link>
    <description>&lt;P&gt;Hi community,&lt;/P&gt;
&lt;P&gt;I have two tables:&lt;/P&gt;
&lt;P&gt;1- Promotion:&lt;/P&gt;
&lt;P&gt;Flyer_ID,&lt;/P&gt;
&lt;P&gt;FROMDT,&lt;/P&gt;
&lt;P&gt;UPTODT,&lt;/P&gt;
&lt;P&gt;PRODUCT&lt;/P&gt;
&lt;P&gt;2- Sales:&lt;/P&gt;
&lt;P&gt;DocNo,&lt;/P&gt;
&lt;P&gt;Product,&lt;/P&gt;
&lt;P&gt;DocDate,&lt;/P&gt;
&lt;P&gt;SalesAmount&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the first table has products that are on Promo during a specific period of time, the second table has sales data for both promo and non promo products. My challenge is how to create a flag or find sales for the products that were under promotion for a specific promotion(Flyer_ID).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to create a table where it checks if the product from sales table had DocDate&amp;gt;= FROMDT and DocDate&amp;lt;=UPTODT, 'in Promo', 'not Promo') as PromoFlag. ( i tried this&amp;nbsp;&lt;A href="https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-product-during-promotion-period-only/td-p/1753184" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-product-during-promotion-period-only/td-p/1753184&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;
&lt;P&gt;But I am getting wrong results. Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Abdulla&lt;/P&gt;</description>
    <pubDate>Sun, 16 Oct 2022 12:09:19 GMT</pubDate>
    <dc:creator>dewan_abdullah</dc:creator>
    <dc:date>2022-10-16T12:09:19Z</dc:date>
    <item>
      <title>How to calculate Sales for a Promotion Period?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-for-a-Promotion-Period/m-p/1993047#M82175</link>
      <description>&lt;P&gt;Hi community,&lt;/P&gt;
&lt;P&gt;I have two tables:&lt;/P&gt;
&lt;P&gt;1- Promotion:&lt;/P&gt;
&lt;P&gt;Flyer_ID,&lt;/P&gt;
&lt;P&gt;FROMDT,&lt;/P&gt;
&lt;P&gt;UPTODT,&lt;/P&gt;
&lt;P&gt;PRODUCT&lt;/P&gt;
&lt;P&gt;2- Sales:&lt;/P&gt;
&lt;P&gt;DocNo,&lt;/P&gt;
&lt;P&gt;Product,&lt;/P&gt;
&lt;P&gt;DocDate,&lt;/P&gt;
&lt;P&gt;SalesAmount&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the first table has products that are on Promo during a specific period of time, the second table has sales data for both promo and non promo products. My challenge is how to create a flag or find sales for the products that were under promotion for a specific promotion(Flyer_ID).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to create a table where it checks if the product from sales table had DocDate&amp;gt;= FROMDT and DocDate&amp;lt;=UPTODT, 'in Promo', 'not Promo') as PromoFlag. ( i tried this&amp;nbsp;&lt;A href="https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-product-during-promotion-period-only/td-p/1753184" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-product-during-promotion-period-only/td-p/1753184&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;
&lt;P&gt;But I am getting wrong results. Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Abdulla&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 12:09:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-for-a-Promotion-Period/m-p/1993047#M82175</guid>
      <dc:creator>dewan_abdullah</dc:creator>
      <dc:date>2022-10-16T12:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales for a Promotion Period?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-for-a-Promotion-Period/m-p/1993054#M82176</link>
      <description>&lt;P&gt;You could solve this by using intervalmatch().&lt;/P&gt;
&lt;P&gt;Take a look at&amp;nbsp; my script below:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Promotion:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LOAD 'Yes' as inPromotion, * inline [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Flyer_ID, FROMDT,UPTODT,Product&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;A, 2022-01-01, 2022-01-31, Christmas decoration&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;B, 2022-10-01, 2022-10-30, Icecream&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;];&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Sales:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LOAD * inline [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DocNo,Product,DocDate,SalesAmount&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;1,Icecream, 2022-07-15, 2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2, Christmas decoration, 2022-12-20, 50&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;3, Christmas decoration, 2022-01-15, 45&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;4, Icecream, 2022-10-02, 1.5&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;];&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#000080"&gt;LEFT JOIN (Promotion) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#000080"&gt;&lt;EM&gt;&lt;STRONG&gt;IntervalMatch&lt;/STRONG&gt; &lt;/EM&gt;(DocDate, Product) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;&lt;FONT face="courier new,courier"&gt;LOAD &lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; FROMDT, &lt;BR /&gt;&amp;nbsp; UPTODT, &lt;BR /&gt;&amp;nbsp; Product &lt;BR /&gt;Resident Promotion;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 15:52:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-for-a-Promotion-Period/m-p/1993054#M82176</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2022-10-16T15:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales for a Promotion Period?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-for-a-Promotion-Period/m-p/1993186#M82193</link>
      <description>&lt;P&gt;Thank you Vegar, it worked!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 09:03:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-for-a-Promotion-Period/m-p/1993186#M82193</guid>
      <dc:creator>dewan_abdullah</dc:creator>
      <dc:date>2022-10-17T09:03:01Z</dc:date>
    </item>
  </channel>
</rss>

