<?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: Applying a Finincial Cap From an Input Value in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Applying-a-Finincial-Cap-From-an-Input-Value/m-p/1872643#M71995</link>
    <description>&lt;P&gt;Not sure this will work when each of the persons has many claim amounts within the time period. in fact, when applying this to my situation reflects the number Zero, probably because at some point in the time period there was a zero claim amount.&lt;/P&gt;
&lt;P&gt;In theory this would be the start&lt;/P&gt;
&lt;P&gt;Aggr(MedPlanPaid, PersonId), this would return the sum of the claim amount by each person as an array. The issue at this point is how to compare the CapValue to each of these array entries to either use the CapValue or the claim value, and then sum these.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Dec 2021 12:37:54 GMT</pubDate>
    <dc:creator>Spartan27215</dc:creator>
    <dc:date>2021-12-17T12:37:54Z</dc:date>
    <item>
      <title>Applying a Finincial Cap From an Input Value</title>
      <link>https://community.qlik.com/t5/App-Development/Applying-a-Finincial-Cap-From-an-Input-Value/m-p/1871190#M71900</link>
      <description>&lt;P&gt;I need to be able to apply a CapValue based on a single persons MedClaims within the time period of the filter context.&lt;/P&gt;
&lt;P&gt;In SQL I would do this by Summing each Persons Medclaims dollar amount. If the amount is greater than CapValue I would use the Cap Value as the dollar total, otherwise I would use the Sum amount. I am trying to figure out how to apply this concept to a Qlik Measure.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;CapValue = 50,000&lt;/P&gt;
&lt;P&gt;PersonId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Applied Value&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20,000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20,000&lt;/P&gt;
&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 75,000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50,000&lt;/P&gt;
&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 35,000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 35,000&lt;/P&gt;
&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50,001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50,000&lt;/P&gt;
&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100,000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50,000&lt;/P&gt;
&lt;P&gt;Total Sum to be returned by measure would be&lt;/P&gt;
&lt;P&gt;20,000+50,000+35,000+50,000+50,000 = &lt;STRONG&gt;205,000&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I feel like I should be able to use the &lt;STRONG&gt;aggr&lt;/STRONG&gt; function similar to &lt;STRONG&gt;aggr&lt;/STRONG&gt;(ClaimValue, PersonId) to summarize the data by person, but no idea what to do with it after than. There do not seem to be any other functions that will deal with the output of this one to apply the comparison logic to etc.&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 22:56:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Applying-a-Finincial-Cap-From-an-Input-Value/m-p/1871190#M71900</guid>
      <dc:creator>Spartan27215</dc:creator>
      <dc:date>2021-12-14T22:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Applying a Finincial Cap From an Input Value</title>
      <link>https://community.qlik.com/t5/App-Development/Applying-a-Finincial-Cap-From-an-Input-Value/m-p/1871878#M71943</link>
      <description>&lt;P&gt;Hi, you could do this:&lt;BR /&gt;&lt;BR /&gt;Create a variable named vCapValue with the value of 50000, then use the variable in the measure like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=SUM(AGGR(RANGEMIN(SUM(Sum),$(vCapValue)),PersonId))&lt;/LI-CODE&gt;
&lt;P&gt;The result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RsQK_1-1639646099798.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/68699i95BFD26791B1329F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RsQK_1-1639646099798.png" alt="RsQK_1-1639646099798.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 09:15:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Applying-a-Finincial-Cap-From-an-Input-Value/m-p/1871878#M71943</guid>
      <dc:creator>RsQK</dc:creator>
      <dc:date>2021-12-16T09:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Applying a Finincial Cap From an Input Value</title>
      <link>https://community.qlik.com/t5/App-Development/Applying-a-Finincial-Cap-From-an-Input-Value/m-p/1872643#M71995</link>
      <description>&lt;P&gt;Not sure this will work when each of the persons has many claim amounts within the time period. in fact, when applying this to my situation reflects the number Zero, probably because at some point in the time period there was a zero claim amount.&lt;/P&gt;
&lt;P&gt;In theory this would be the start&lt;/P&gt;
&lt;P&gt;Aggr(MedPlanPaid, PersonId), this would return the sum of the claim amount by each person as an array. The issue at this point is how to compare the CapValue to each of these array entries to either use the CapValue or the claim value, and then sum these.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 12:37:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Applying-a-Finincial-Cap-From-an-Input-Value/m-p/1872643#M71995</guid>
      <dc:creator>Spartan27215</dc:creator>
      <dc:date>2021-12-17T12:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Applying a Finincial Cap From an Input Value</title>
      <link>https://community.qlik.com/t5/App-Development/Applying-a-Finincial-Cap-From-an-Input-Value/m-p/1873076#M72024</link>
      <description>&lt;P&gt;What the formula does is it calculates the total amount of MedPlanPaid for each PersonId, then compares it to the vCapValue and gives the result, there's absolutely no difference whether there's 1 record per PersonId or a million. I generated a test table with this code:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;data:
LOAD
ROUND(RAND(),0.25) AS MedPlanPaid,
MOD(ROWNO(),100)+1 AS PersonId
AUTOGENERATE 10000000;&lt;/LI-CODE&gt;
&lt;P&gt;Resulting data set has 100k records per PersonId, also zeros as the MedPlanPaid. The formula I suggested before still works:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RsQK_0-1639981453860.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/68902i2B5E56F1A5F12884/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RsQK_0-1639981453860.png" alt="RsQK_0-1639981453860.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 06:24:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Applying-a-Finincial-Cap-From-an-Input-Value/m-p/1873076#M72024</guid>
      <dc:creator>RsQK</dc:creator>
      <dc:date>2021-12-20T06:24:35Z</dc:date>
    </item>
  </channel>
</rss>

