<?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: Calculate Dimension value for a max / min Measure in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-Dimension-value-for-a-max-min-Measure/m-p/97475#M457537</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;for getting the year with max value you can use this expression &lt;/P&gt;&lt;P&gt;FirstSortedValue(Year,-aggr( sum([Citizens])/Sum([Older people]),Year))&lt;/P&gt;&lt;P&gt;for finding the minimum year between the set of values you can use this expressions &lt;/P&gt;&lt;P&gt;min(aggr(if(sum([Citizens])/Sum([Older people])&amp;gt;=1.8 and sum([Citizens])/Sum([Older people])&amp;lt;=2.2,Year),Year))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Oct 2018 05:57:32 GMT</pubDate>
    <dc:creator>lironbaram</dc:creator>
    <dc:date>2018-10-12T05:57:32Z</dc:date>
    <item>
      <title>Calculate Dimension value for a max / min Measure</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Dimension-value-for-a-max-min-Measure/m-p/97474#M457536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;Hi, my problem is to calculate a kpi in the following context.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;I have the following Dimensions:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;Year&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;Area&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;and Measures:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;Citizens (global number of citizens)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;Older people (number of citizens &amp;gt; 80)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;I’m interested in Indicator = Older people / Citizens.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;Data Set sample is as follows:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;&lt;IMG alt="Data Set.png" class="jive-image image-1" src="/legacyfs/online/215729_Data Set.png" style="height: 349px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;&lt;STRONG&gt;How to calculate the Kpi corresponding to the Year in wich Indicator is max o min?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;Es: in the following tab the KPI is: 2001 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;&lt;IMG alt="Data Set.png" class="jive-image image-2" src="/legacyfs/online/215730_Data Set.png" style="height: 349px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;&lt;STRONG&gt;And what about if I need to calculate the Year in wich the Indicator is &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #3d3d3d; font-size: 10.0pt; font-family: 'Cambria Math',serif;"&gt;≃&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;&lt;STRONG&gt; 2 (between 1.8 and 2.2)?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3d3d3d;"&gt;For the case above&amp;nbsp; I’ll have Year = 2003,2007,2008. I choose min -&amp;gt; 2003.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2018 21:13:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Dimension-value-for-a-max-min-Measure/m-p/97474#M457536</guid>
      <dc:creator>maschiliro</dc:creator>
      <dc:date>2018-10-11T21:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Dimension value for a max / min Measure</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Dimension-value-for-a-max-min-Measure/m-p/97475#M457537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;for getting the year with max value you can use this expression &lt;/P&gt;&lt;P&gt;FirstSortedValue(Year,-aggr( sum([Citizens])/Sum([Older people]),Year))&lt;/P&gt;&lt;P&gt;for finding the minimum year between the set of values you can use this expressions &lt;/P&gt;&lt;P&gt;min(aggr(if(sum([Citizens])/Sum([Older people])&amp;gt;=1.8 and sum([Citizens])/Sum([Older people])&amp;lt;=2.2,Year),Year))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2018 05:57:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Dimension-value-for-a-max-min-Measure/m-p/97475#M457537</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2018-10-12T05:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Dimension value for a max / min Measure</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Dimension-value-for-a-max-min-Measure/m-p/97476#M457538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Liron,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your answer is very useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the second part of the question I tried your suggestion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*min(aggr(if(sum()/Sum()&amp;gt;=1.8 and&lt;/P&gt;&lt;P&gt;sum()/Sum()&amp;lt;=2.2,Year),Year))*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that the "aggr function with if  inside" has a wrong syntax, and&lt;/P&gt;&lt;P&gt;doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you help me, please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Il giorno ven 12 ott 2018 alle ore 07:57 Liron Baram &amp;lt;&lt;/P&gt;&lt;P&gt;qcwebmaster@qlikview.com&amp;gt; ha scritto:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2018 08:57:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Dimension-value-for-a-max-min-Measure/m-p/97476#M457538</guid>
      <dc:creator>maschiliro</dc:creator>
      <dc:date>2018-10-12T08:57:04Z</dc:date>
    </item>
  </channel>
</rss>

