<?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: KPI with conditions in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/KPI-with-conditions/m-p/1618049#M46033</link>
    <description>&lt;P&gt;After modifying your suggestion it seems to work correctly:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sum(aggr(&lt;BR /&gt;IF(&lt;STRONG&gt;&lt;FONT color="#ff6600"&gt;aggr&lt;/FONT&gt;&lt;/STRONG&gt;(sum({&amp;lt;PurchOrder_Line_Flag_Received ={1},PurchOrder_Date = {"&amp;gt;=$(vDatePrev12Months) &amp;lt;=$(vMaxCreateDate)"}&amp;gt;}PurchOrder_Line_TotalPriceUSD),Key_Supp_Company) &amp;gt; vSupplierMinAmount_USD,&lt;BR /&gt;count({&amp;lt;PurchOrder_Line_OTDState = {'On Time Delivery'}&amp;gt;} distinct Key_PurchOrderLineID_Company),Null())&lt;BR /&gt;, Key_Supp_Company))&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2019 07:55:02 GMT</pubDate>
    <dc:creator>dana</dc:creator>
    <dc:date>2019-08-29T07:55:02Z</dc:date>
    <item>
      <title>KPI with conditions</title>
      <link>https://community.qlik.com/t5/App-Development/KPI-with-conditions/m-p/1618035#M46029</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to calculate number of Purchase Orders lines for suppliers which include a condition:&lt;/P&gt;&lt;P&gt;Purchasing amount should be greater than an amount define dynamically by the user for the previous 12 months.&lt;/P&gt;&lt;P&gt;In a straight table, with the supplier key as a dimension it works fine.&lt;/P&gt;&lt;P&gt;IF(sum({&amp;lt;PurchOrder_Line_Flag_Received ={1},PurchOrder_Date = {"&amp;gt;=$(vDatePrev12Months) &amp;lt;=$(vMaxCreateDate)"}&amp;gt;}PurchOrder_Line_TotalPriceUSD) &amp;gt; vSupplierMinAmount_USD,&lt;BR /&gt;count( distinct PurchOrderLineID_Company),Null())&lt;/P&gt;&lt;P&gt;I want to use this metric in a KPI object. Figured the AGGR function should be used.&lt;/P&gt;&lt;P&gt;Tried the following expression but it doesn't work:&lt;/P&gt;&lt;P&gt;sum(IF(aggr(sum({&amp;lt;PurchOrder_Line_Flag_Received ={1},PurchOrder_Date = {"&amp;gt;=$(vDatePrev12Months) &amp;lt;=$(vMaxCreateDate&amp;gt;}PurchOrder_Line_TotalPriceUSD),Key_Supp_Company)&amp;gt; vSupplierMinAmount_USD,&lt;BR /&gt;aggr(count distinct Key_PurchOrderLineID_Company),Key_Supp_Company),Null())&lt;/P&gt;&lt;P&gt;Help would be much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:10:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/KPI-with-conditions/m-p/1618035#M46029</guid>
      <dc:creator>dana</dc:creator>
      <dc:date>2024-11-16T20:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: KPI with conditions</title>
      <link>https://community.qlik.com/t5/App-Development/KPI-with-conditions/m-p/1618040#M46031</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;sum(aggr(&lt;/P&gt;&lt;P&gt;IF(sum({&amp;lt;PurchOrder_Line_Flag_Received ={1},PurchOrder_Date = {"&amp;gt;=$(vDatePrev12Months) &amp;lt;=$(vMaxCreateDate)"}&amp;gt;}PurchOrder_Line_TotalPriceUSD) &amp;gt; vSupplierMinAmount_USD,&lt;BR /&gt;count( distinct PurchOrderLineID_Company),Null())&lt;/P&gt;&lt;P&gt;, Key_Supp_Company))&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 07:26:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/KPI-with-conditions/m-p/1618040#M46031</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2019-08-29T07:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: KPI with conditions</title>
      <link>https://community.qlik.com/t5/App-Development/KPI-with-conditions/m-p/1618043#M46032</link>
      <description>&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;Thanks for your prompt supply!&lt;/P&gt;&lt;P&gt;Is the first expression&amp;nbsp; you modified calculated per supplier?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IF(sum({&amp;lt;PurchOrder_Line_Flag_Received ={1},PurchOrder_Date = {"&amp;gt;=$(vDatePrev12Months) &amp;lt;=$(vMaxCreateDate)"}&amp;gt;}PurchOrder_Line_TotalPriceUSD) &amp;gt; vSupplierMinAmount_USD,&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 07:38:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/KPI-with-conditions/m-p/1618043#M46032</guid>
      <dc:creator>dana</dc:creator>
      <dc:date>2019-08-29T07:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: KPI with conditions</title>
      <link>https://community.qlik.com/t5/App-Development/KPI-with-conditions/m-p/1618049#M46033</link>
      <description>&lt;P&gt;After modifying your suggestion it seems to work correctly:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sum(aggr(&lt;BR /&gt;IF(&lt;STRONG&gt;&lt;FONT color="#ff6600"&gt;aggr&lt;/FONT&gt;&lt;/STRONG&gt;(sum({&amp;lt;PurchOrder_Line_Flag_Received ={1},PurchOrder_Date = {"&amp;gt;=$(vDatePrev12Months) &amp;lt;=$(vMaxCreateDate)"}&amp;gt;}PurchOrder_Line_TotalPriceUSD),Key_Supp_Company) &amp;gt; vSupplierMinAmount_USD,&lt;BR /&gt;count({&amp;lt;PurchOrder_Line_OTDState = {'On Time Delivery'}&amp;gt;} distinct Key_PurchOrderLineID_Company),Null())&lt;BR /&gt;, Key_Supp_Company))&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 07:55:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/KPI-with-conditions/m-p/1618049#M46033</guid>
      <dc:creator>dana</dc:creator>
      <dc:date>2019-08-29T07:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: KPI with conditions</title>
      <link>https://community.qlik.com/t5/App-Development/KPI-with-conditions/m-p/1618192#M46045</link>
      <description>&lt;P&gt;I was wrong..&lt;/P&gt;&lt;P&gt;Gysbert solution is perfect..&lt;/P&gt;&lt;P&gt;I misunderstood it.. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 11:41:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/KPI-with-conditions/m-p/1618192#M46045</guid>
      <dc:creator>dana</dc:creator>
      <dc:date>2019-08-29T11:41:12Z</dc:date>
    </item>
  </channel>
</rss>

