<?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: How to write expression for below requirement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1547816#M457076</link>
    <description>&lt;P&gt;Hello &amp;nbsp;Sunny,&lt;/P&gt;&lt;P&gt;As requested i am attaching a sample QVW file ,with partial achieved calculated Dimension expression &lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture.PNG" style="width: 674px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6564i8E9B81EFAF8C3264/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Requirement &amp;nbsp;&lt;/P&gt;&lt;P&gt;For AGS instead of showing &amp;nbsp;L5-M,L9-O &amp;nbsp;(N)as Dimension values &amp;nbsp;i need to show L5-DH and L8-O &amp;nbsp; (N+1)&lt;/P&gt;</description>
    <pubDate>Fri, 22 Feb 2019 06:16:48 GMT</pubDate>
    <dc:creator>kunkumnaveen</dc:creator>
    <dc:date>2019-02-22T06:16:48Z</dc:date>
    <item>
      <title>How to write expression for below requirement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1547556#M457074</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;Need &amp;nbsp;help in achieving a &amp;nbsp;requirement , Having a sample data in below format ,&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 992px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6502iCCB32442A2E14C6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With two Dimensions(Type,Level) and a Expression&lt;/P&gt;&lt;P&gt;The requirement :&lt;/P&gt;&lt;P&gt;Every Type has L1 to L10 values , so the requirement is instead of showing all the level for each Type, show only those level which satisfy &amp;nbsp;below condition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Condition : &amp;nbsp; N+1/N &amp;gt; 1 &amp;nbsp; and N+2/N+1&amp;lt;1&lt;/P&gt;&lt;P&gt;For Example&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6504i56678DF8AAA58711/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;NOTE:Every row value is considered as N and top of that value is considered as N+1,N+2&lt;/P&gt;&lt;P&gt;From the above pic &amp;nbsp;&lt;STRONG&gt;N=L9-O (115) and N+1=L8-O(196) AND N+2=L7-O(156)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;so by the condition &amp;nbsp;= &amp;nbsp; &amp;nbsp;&amp;nbsp;N+1/N &amp;gt; 1 &amp;nbsp; and N+2/N+1&amp;lt;1 &amp;nbsp;&lt;/P&gt;&lt;P&gt;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 196/115 &amp;nbsp;&amp;gt;1 true &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; and&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 156/196 &amp;nbsp;&amp;lt;1 &amp;nbsp; true&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so the &amp;nbsp;condition is satisfied , &amp;nbsp;so &amp;nbsp; for Type AGS one level will be &amp;nbsp; L9-O &amp;nbsp;(N)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so i have achieved this requirement by writing below expression in Dimension&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF((&lt;BR /&gt;Aggr(below(Count(distinct {&amp;lt;FY={$(vMaxU_FY)}, CLOS_HC_FLAGCFY={1}&amp;gt;} EMPID_IVOE))&lt;BR /&gt;, Type&lt;BR /&gt;, (LevelNo,(NUMERIC, DESCENDING))&lt;BR /&gt;)&lt;BR /&gt;/&lt;BR /&gt;Aggr(Count(distinct {&amp;lt;FY={$(vMaxU_FY)}, CLOS_HC_FLAGCFY={1}&amp;gt;} EMPID_IVOE), Type, Level)&lt;BR /&gt;) &amp;gt; 1&lt;BR /&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;(&lt;BR /&gt;Aggr(below(Count(distinct {&amp;lt;FY={$(vMaxU_FY)}, CLOS_HC_FLAGCFY={1}&amp;gt;} EMPID_IVOE), 2)&lt;BR /&gt;, Type&lt;BR /&gt;, (LevelNo,(NUMERIC, DESCENDING))&lt;BR /&gt;)&lt;BR /&gt;/&lt;BR /&gt;Aggr(below(Count(distinct {&amp;lt;FY={$(vMaxU_FY)}, CLOS_HC_FLAGCFY={1}&amp;gt;} EMPID_IVOE))&lt;BR /&gt;, Type&lt;BR /&gt;, (LevelNo,(NUMERIC, DESCENDING))&lt;BR /&gt;)&lt;BR /&gt;) &amp;lt; 1&lt;BR /&gt;,&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;(Level)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By above expression i am getting N value from Level ,but want i need is instead of N value show N+1 value&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the above case instead of &amp;nbsp;L9-O i need to show L8-O &amp;nbsp; ,if N value is satisfied the condition then pick N+1 has out put, &amp;nbsp;&lt;/P&gt;&lt;P&gt;so in the above expression In the place of &lt;FONT color="#FF6600"&gt;LEVEL&lt;/FONT&gt;. wat should i need to write&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:54:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1547556#M457074</guid>
      <dc:creator>kunkumnaveen</dc:creator>
      <dc:date>2019-02-21T13:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to write expression for below requirement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1547568#M457075</link>
      <description>&lt;P&gt;Would you be able to share a qvw sample to see what you already have and work with it to get you to what you want?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 14:05:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1547568#M457075</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-02-21T14:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to write expression for below requirement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1547816#M457076</link>
      <description>&lt;P&gt;Hello &amp;nbsp;Sunny,&lt;/P&gt;&lt;P&gt;As requested i am attaching a sample QVW file ,with partial achieved calculated Dimension expression &lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture.PNG" style="width: 674px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6564i8E9B81EFAF8C3264/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Requirement &amp;nbsp;&lt;/P&gt;&lt;P&gt;For AGS instead of showing &amp;nbsp;L5-M,L9-O &amp;nbsp;(N)as Dimension values &amp;nbsp;i need to show L5-DH and L8-O &amp;nbsp; (N+1)&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 06:16:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1547816#M457076</guid>
      <dc:creator>kunkumnaveen</dc:creator>
      <dc:date>2019-02-22T06:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to write expression for below requirement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1547817#M457077</link>
      <description />
      <pubDate>Fri, 22 Feb 2019 06:17:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1547817#M457077</guid>
      <dc:creator>kunkumnaveen</dc:creator>
      <dc:date>2019-02-22T06:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to write expression for below requirement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1547977#M457078</link>
      <description>&lt;P&gt;Hello any suggestion ,on above requirement&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 10:04:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1547977#M457078</guid>
      <dc:creator>kunkumnaveen</dc:creator>
      <dc:date>2019-02-22T10:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to write expression for below requirement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1548050#M457079</link>
      <description>&lt;P&gt;Checking it now&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 12:14:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1548050#M457079</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-02-22T12:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to write expression for below requirement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1548056#M457080</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1135"&gt;@kunkumnaveen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture.PNG" style="width: 674px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6564i8E9B81EFAF8C3264/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For AGS instead of showing &amp;nbsp;L5-M,L9-O &amp;nbsp;(N)as Dimension values &amp;nbsp;i need to show L5-DH and L8-O &amp;nbsp; (N+1)&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;How about the Level for AMS and CS? Would they also change to L7-O?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 623px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6597i7BA5AB7AE3BB1F70/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Calculated dimension&lt;/P&gt;&lt;PRE&gt;=Aggr(&lt;BR /&gt;  If(&lt;BR /&gt;    Below(Sum(DISTINCT {&amp;lt;FY={'2018'}&amp;gt;} Expression))/&lt;BR /&gt;    Sum(DISTINCT {&amp;lt;FY={'2018'}&amp;gt;} Expression) &amp;gt; 1&lt;BR /&gt;    and 
    Below(Sum(DISTINCT {&amp;lt;FY={'2018'}&amp;gt;} Expression), 2)/&lt;BR /&gt;    Below(Sum(DISTINCT {&amp;lt;FY={'2018'}&amp;gt;} Expression)) &amp;lt; 1&lt;BR /&gt;  , &lt;FONT color="#FF0000"&gt;Below(Level)&lt;/FONT&gt;)&lt;BR /&gt;, Type, (LevelNo,(NUMERIC, DESCENDING)))&lt;/PRE&gt;&lt;P&gt;The only thing I really changed was to use Below(Level) instead of Level. But I also removed the multiple usage of Aggr() as it seems that you were essentially aggregating on the same fields. If Level and levelNo are not one to one for each Type, then you might have to change back to your original calculated dimension and use Below(Level).&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 12:27:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1548056#M457080</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-02-22T12:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to write expression for below requirement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1548491#M457081</link>
      <description>&lt;P&gt;&amp;nbsp; Thanks You,It worked&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 03:53:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-expression-for-below-requirement/m-p/1548491#M457081</guid>
      <dc:creator>kunkumnaveen</dc:creator>
      <dc:date>2019-02-25T03:53:46Z</dc:date>
    </item>
  </channel>
</rss>

