<?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 expression for accumulated years in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/expression-for-accumulated-years/m-p/1305295#M824555</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a newbie to QlikView. I have requirement to calculate value based on certain criteria. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below is the input table in the QlikView&lt;/P&gt;&lt;P&gt;&lt;IMG alt="primaryTable.JPG" class="jive-image image-1" height="247" src="https://community.qlik.com/legacyfs/online/170140_primaryTable.JPG" style="height: 247px; width: 257.885px;" width="258" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;conditions:&lt;/STRONG&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;for each month in the same year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if(Jan) -&amp;gt; sum of &lt;SPAN style="font-size: 13.3333px;"&gt;RiskCategory&lt;/SPAN&gt; weights in Jan of the same year&lt;/P&gt;&lt;P&gt;if(Feb) --&amp;gt; sum of &lt;SPAN style="font-size: 13.3333px;"&gt;RiskCategory&lt;/SPAN&gt; weights in Jan and Feb of the same year&lt;/P&gt;&lt;P&gt;if(March)-- &amp;gt; sum of &lt;SPAN style="font-size: 13.3333px;"&gt;RiskCategory&lt;/SPAN&gt; weights from Jan to March&amp;nbsp; of the same year&lt;/P&gt;&lt;P&gt;if(April) --&amp;gt; sum of RiskCategory weights from Jan to April&amp;nbsp; of the same year&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;if(Dec) --&amp;gt; sum of &lt;SPAN style="font-size: 13.3333px;"&gt;RiskCategory&lt;/SPAN&gt; weights from January to December&amp;nbsp; of the same year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**if multiple &lt;SPAN style="font-size: 13.3333px;"&gt;RiskCategor&lt;/SPAN&gt;ies existed for any month we should take one occurrence of risk category which is having maximum risk weight&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For example&lt;/STRONG&gt; if we want to calculate riskweight for the month of November in 2016 then we should consider the below rows only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE height="23" style="width: 506px; height: 5px;" width="504"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl48" height="19" width="28"&gt;ID&lt;/TD&gt;&lt;TD class="xl48" width="69"&gt;Month&lt;/TD&gt;&lt;TD class="xl48" width="36"&gt;Year&lt;/TD&gt;&lt;TD class="xl48" width="98"&gt;RiskCategory&lt;/TD&gt;&lt;TD class="xl48" width="72"&gt;RiskWeight&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE height="174" style="width: 644px; height: 178px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl49" height="19" width="28"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl49" width="69"&gt;October&lt;/TD&gt;&lt;TD align="right" class="xl49" width="36"&gt;2016&lt;/TD&gt;&lt;TD class="xl49" width="98"&gt;Cardiovascular&lt;/TD&gt;&lt;TD align="right" class="xl49" width="72"&gt;0.649&lt;/TD&gt;&lt;TD align="right" class="xl49" width="72"&gt;1st occurrence&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl49" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl49"&gt;October&lt;/TD&gt;&lt;TD align="right" class="xl49"&gt;2016&lt;/TD&gt;&lt;TD class="xl49"&gt;Pulmonary&lt;/TD&gt;&lt;TD align="right" class="xl49"&gt;0.341&lt;/TD&gt;&lt;TD align="right" class="xl49"&gt;1st occurrence&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl50" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl50"&gt;November&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2016&lt;/TD&gt;&lt;TD class="xl50"&gt;Cardiovascular&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;0.649&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2nd occurrence&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl50" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl50"&gt;November&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2016&lt;/TD&gt;&lt;TD class="xl50"&gt;Diabetes type 2&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;0.666&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl50" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl50"&gt;November&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2016&lt;/TD&gt;&lt;TD class="xl50"&gt;Psychiatric&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;0.798&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl50" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl50"&gt;November&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2016&lt;/TD&gt;&lt;TD class="xl50"&gt;Pulmonary&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;1.037&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2nd occurrence &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl50" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl50"&gt;November&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2016&lt;/TD&gt;&lt;TD class="xl50"&gt;Renal&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;1.896&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;** since I do not have data from January to September in 2016 i have considered only October and November data for November month calculation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now the result should be &lt;STRONG&gt;(0.649 for &lt;SPAN style="font-size: 13.3333px;"&gt;Cardiovascular&lt;/SPAN&gt;+ 1.037 for &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Pulmonary + 0.666 for &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Diabetes type 2 + 0.798 for &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Psychiatric + 1.896 for Renal ) + constant value of 0.536&lt;/STRONG&gt;&amp;nbsp; = 5.582&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the&amp;nbsp; result table should be &lt;/P&gt;&lt;P&gt;&lt;IMG alt="finalTable.JPG" class="jive-image image-2" height="126" src="https://community.qlik.com/legacyfs/online/170163_finalTable.JPG" style="height: 125.755px; width: 189px;" width="189" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if this is possible through the expression and help me to solve the logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: there multiple ID's will be existed in the table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>expression for accumulated years</title>
      <link>https://community.qlik.com/t5/QlikView/expression-for-accumulated-years/m-p/1305295#M824555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a newbie to QlikView. I have requirement to calculate value based on certain criteria. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below is the input table in the QlikView&lt;/P&gt;&lt;P&gt;&lt;IMG alt="primaryTable.JPG" class="jive-image image-1" height="247" src="https://community.qlik.com/legacyfs/online/170140_primaryTable.JPG" style="height: 247px; width: 257.885px;" width="258" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;conditions:&lt;/STRONG&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;for each month in the same year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if(Jan) -&amp;gt; sum of &lt;SPAN style="font-size: 13.3333px;"&gt;RiskCategory&lt;/SPAN&gt; weights in Jan of the same year&lt;/P&gt;&lt;P&gt;if(Feb) --&amp;gt; sum of &lt;SPAN style="font-size: 13.3333px;"&gt;RiskCategory&lt;/SPAN&gt; weights in Jan and Feb of the same year&lt;/P&gt;&lt;P&gt;if(March)-- &amp;gt; sum of &lt;SPAN style="font-size: 13.3333px;"&gt;RiskCategory&lt;/SPAN&gt; weights from Jan to March&amp;nbsp; of the same year&lt;/P&gt;&lt;P&gt;if(April) --&amp;gt; sum of RiskCategory weights from Jan to April&amp;nbsp; of the same year&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;if(Dec) --&amp;gt; sum of &lt;SPAN style="font-size: 13.3333px;"&gt;RiskCategory&lt;/SPAN&gt; weights from January to December&amp;nbsp; of the same year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**if multiple &lt;SPAN style="font-size: 13.3333px;"&gt;RiskCategor&lt;/SPAN&gt;ies existed for any month we should take one occurrence of risk category which is having maximum risk weight&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For example&lt;/STRONG&gt; if we want to calculate riskweight for the month of November in 2016 then we should consider the below rows only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE height="23" style="width: 506px; height: 5px;" width="504"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl48" height="19" width="28"&gt;ID&lt;/TD&gt;&lt;TD class="xl48" width="69"&gt;Month&lt;/TD&gt;&lt;TD class="xl48" width="36"&gt;Year&lt;/TD&gt;&lt;TD class="xl48" width="98"&gt;RiskCategory&lt;/TD&gt;&lt;TD class="xl48" width="72"&gt;RiskWeight&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE height="174" style="width: 644px; height: 178px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl49" height="19" width="28"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl49" width="69"&gt;October&lt;/TD&gt;&lt;TD align="right" class="xl49" width="36"&gt;2016&lt;/TD&gt;&lt;TD class="xl49" width="98"&gt;Cardiovascular&lt;/TD&gt;&lt;TD align="right" class="xl49" width="72"&gt;0.649&lt;/TD&gt;&lt;TD align="right" class="xl49" width="72"&gt;1st occurrence&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl49" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl49"&gt;October&lt;/TD&gt;&lt;TD align="right" class="xl49"&gt;2016&lt;/TD&gt;&lt;TD class="xl49"&gt;Pulmonary&lt;/TD&gt;&lt;TD align="right" class="xl49"&gt;0.341&lt;/TD&gt;&lt;TD align="right" class="xl49"&gt;1st occurrence&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl50" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl50"&gt;November&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2016&lt;/TD&gt;&lt;TD class="xl50"&gt;Cardiovascular&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;0.649&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2nd occurrence&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl50" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl50"&gt;November&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2016&lt;/TD&gt;&lt;TD class="xl50"&gt;Diabetes type 2&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;0.666&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl50" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl50"&gt;November&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2016&lt;/TD&gt;&lt;TD class="xl50"&gt;Psychiatric&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;0.798&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl50" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl50"&gt;November&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2016&lt;/TD&gt;&lt;TD class="xl50"&gt;Pulmonary&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;1.037&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2nd occurrence &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl50" height="19"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl50"&gt;November&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;2016&lt;/TD&gt;&lt;TD class="xl50"&gt;Renal&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;1.896&lt;/TD&gt;&lt;TD align="right" class="xl50"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;** since I do not have data from January to September in 2016 i have considered only October and November data for November month calculation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now the result should be &lt;STRONG&gt;(0.649 for &lt;SPAN style="font-size: 13.3333px;"&gt;Cardiovascular&lt;/SPAN&gt;+ 1.037 for &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Pulmonary + 0.666 for &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Diabetes type 2 + 0.798 for &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Psychiatric + 1.896 for Renal ) + constant value of 0.536&lt;/STRONG&gt;&amp;nbsp; = 5.582&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the&amp;nbsp; result table should be &lt;/P&gt;&lt;P&gt;&lt;IMG alt="finalTable.JPG" class="jive-image image-2" height="126" src="https://community.qlik.com/legacyfs/online/170163_finalTable.JPG" style="height: 125.755px; width: 189px;" width="189" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if this is possible through the expression and help me to solve the logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: there multiple ID's will be existed in the table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-for-accumulated-years/m-p/1305295#M824555</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
  </channel>
</rss>

