<?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: Sum Prior year Measure only for products sold in the current year? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-Prior-year-Measure-only-for-products-sold-in-the-current/m-p/1776451#M60195</link>
    <description>&lt;P&gt;I don't think you need to use an intersection in your set analysis.&amp;nbsp; Also, the P() function to be bracketed with {&amp;lt; &amp;gt;}.&amp;nbsp; Try this:&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;FiscalYear={"FY20"},ProductID=P({&amp;lt;FiscalYear={"FY21"}, InvoiceAmount={"&amp;gt;0"}&amp;gt;} ProductID)&amp;gt;} InvoiceAmount)&lt;/P&gt;&lt;P&gt;Also, not sure that you need InvoiceAmount={"&amp;gt;0"}, but you can test that.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2021 18:37:38 GMT</pubDate>
    <dc:creator>GaryGiles</dc:creator>
    <dc:date>2021-01-21T18:37:38Z</dc:date>
    <item>
      <title>Sum Prior year Measure only for products sold in the current year?</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-Prior-year-Measure-only-for-products-sold-in-the-current/m-p/1776413#M60189</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Using the following fields in the model: FiscalYear, InvoiceAmount, and ProductID I need to write a sum with set analysis that will sum all the InvoiceAmt from the prior fiscal year but only for products sold in the current fiscal year.&lt;/P&gt;&lt;P&gt;I thought this might do it:&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;FiscalYear={"FY20"}&amp;gt;*$&amp;lt;ProductID=P({FiscalYear={"FY21"}, InvoiceAmount={"&amp;gt;0"} ProductID)&amp;gt;} InvoiceAmount)&lt;/P&gt;&lt;P&gt;It is not producing the expected results since there are rows in the table for a productID with zero InvoiceAmount in the current year and &amp;gt;0 in the prior year.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 16:59:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-Prior-year-Measure-only-for-products-sold-in-the-current/m-p/1776413#M60189</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2021-01-21T16:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Prior year Measure only for products sold in the current year?</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-Prior-year-Measure-only-for-products-sold-in-the-current/m-p/1776451#M60195</link>
      <description>&lt;P&gt;I don't think you need to use an intersection in your set analysis.&amp;nbsp; Also, the P() function to be bracketed with {&amp;lt; &amp;gt;}.&amp;nbsp; Try this:&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;FiscalYear={"FY20"},ProductID=P({&amp;lt;FiscalYear={"FY21"}, InvoiceAmount={"&amp;gt;0"}&amp;gt;} ProductID)&amp;gt;} InvoiceAmount)&lt;/P&gt;&lt;P&gt;Also, not sure that you need InvoiceAmount={"&amp;gt;0"}, but you can test that.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 18:37:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-Prior-year-Measure-only-for-products-sold-in-the-current/m-p/1776451#M60195</guid>
      <dc:creator>GaryGiles</dc:creator>
      <dc:date>2021-01-21T18:37:38Z</dc:date>
    </item>
  </channel>
</rss>

