<?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: Best way to to calculate royalty depending on date of sale in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Best-way-to-to-calculate-royalty-depending-on-date-of-sale/m-p/809960#M1027124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would use the &lt;EM&gt;intervalmatch()&lt;/EM&gt; function on the &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;startdate&lt;/SPAN&gt; and &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;stopdate &lt;/SPAN&gt;of your &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;ROYALTIES &lt;/SPAN&gt;table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This blog post &lt;A href="https://community.qlik.com/qlik-blogpost/3037"&gt;IntervalMatch&lt;/A&gt; by Henric explains the method well..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 Mar 2015 20:02:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-03-01T20:02:12Z</dc:date>
    <item>
      <title>Best way to to calculate royalty depending on date of sale</title>
      <link>https://community.qlik.com/t5/QlikView/Best-way-to-to-calculate-royalty-depending-on-date-of-sale/m-p/809959#M1027123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have 3 tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SALES (with one row per sale of a product). Fields:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;productid&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;date&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;price&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PRODUCTS (with one row per product that can be sold). Fields:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;productid&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;royaltyid&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ROYALTIES (with one row per royalty amount per product and a date range)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;royaltyid&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;amount&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;startdate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;stopdate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How these tables are linked is pretty simple, with one product per sale. And one royalty per product and date of sale.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would you calculate the sum of sales in this case? I would like to do something like "Sum(price - amount)" in my app, but that only works if I only have one fixed royalty for each product. In my case, some products have varying royalty amounts depending on date of sale, which makes things more complicated. I guess I could join the royalties table onto SALES during load-time using conditionals, or I could do some fancy Set Analysis in the App. How would you do it and why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Mar 2015 19:38:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-way-to-to-calculate-royalty-depending-on-date-of-sale/m-p/809959#M1027123</guid>
      <dc:creator />
      <dc:date>2015-03-01T19:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to to calculate royalty depending on date of sale</title>
      <link>https://community.qlik.com/t5/QlikView/Best-way-to-to-calculate-royalty-depending-on-date-of-sale/m-p/809960#M1027124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would use the &lt;EM&gt;intervalmatch()&lt;/EM&gt; function on the &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;startdate&lt;/SPAN&gt; and &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;stopdate &lt;/SPAN&gt;of your &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;ROYALTIES &lt;/SPAN&gt;table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This blog post &lt;A href="https://community.qlik.com/qlik-blogpost/3037"&gt;IntervalMatch&lt;/A&gt; by Henric explains the method well..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Mar 2015 20:02:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-way-to-to-calculate-royalty-depending-on-date-of-sale/m-p/809960#M1027124</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-01T20:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to to calculate royalty depending on date of sale</title>
      <link>https://community.qlik.com/t5/QlikView/Best-way-to-to-calculate-royalty-depending-on-date-of-sale/m-p/809961#M1027126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, thats it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a little bit afraid that I will count sales twice if I accidentally create overlapping periods in my ROYALTIES-table. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 08:34:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-way-to-to-calculate-royalty-depending-on-date-of-sale/m-p/809961#M1027126</guid>
      <dc:creator />
      <dc:date>2015-03-02T08:34:30Z</dc:date>
    </item>
  </channel>
</rss>

