<?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: Median Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Median-Expression/m-p/1133542#M372391</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You use the implicit aggregation function Only() when you don't specify on explicitly. And you need to add the set modifier to that aggregation too. So you must make the aggregation explicit:"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Median({&amp;lt;&lt;SPAN style="font-size: 13.33px;"&gt;empid=,branch=, &lt;SPAN style="font-size: 13.33px;"&gt;flag =, &lt;SPAN style="font-size: 13.33px;"&gt;position=&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;gt;}&amp;nbsp; aggr( &lt;STRONG&gt;only({&amp;lt;&lt;SPAN style="font-size: 13.33px;"&gt;empid=,branch=, &lt;SPAN style="font-size: 13.33px;"&gt;flag =, &lt;SPAN style="font-size: 13.33px;"&gt;position=&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;gt;}&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.33px;"&gt;&lt;STRONG&gt;weight)&lt;/STRONG&gt; ,&lt;SPAN style="font-size: 13.33px;"&gt;branch,&lt;SPAN style="font-size: 13.33px;"&gt;flag, &lt;SPAN style="font-size: 13.33px;"&gt;position&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to use sum() instead of only() if there are several weight values per combination of empid, branch, flag and position values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jul 2016 06:41:18 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2016-07-25T06:41:18Z</dc:date>
    <item>
      <title>Median Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Median-Expression/m-p/1133540#M372389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I am trying to write an Expression in a chart object to calculate the median of weight.&lt;/P&gt;&lt;P&gt;I have date, empid, branch,flag and position. And i have a history of 3 years data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i would like to calculate the median of weight for past 24 months, excluding current month. I tried below expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Median({&amp;lt;&lt;SPAN style="font-size: 13.3333px;"&gt;empid=,branch=, &lt;SPAN style="font-size: 13.3333px;"&gt;flag =, &lt;SPAN style="font-size: 13.3333px;"&gt;position=,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;gt;}&amp;nbsp; aggr( &lt;SPAN style="font-size: 13.3333px;"&gt;weight,&lt;SPAN style="font-size: 13.3333px;"&gt;branch,&lt;SPAN style="font-size: 13.3333px;"&gt;flag, &lt;SPAN style="font-size: 13.3333px;"&gt;position&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;When no selection made i am getting correct median. But if i select an empid, the median is changing also i have to add date selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some please Advise.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 03:42:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Median-Expression/m-p/1133540#M372389</guid>
      <dc:creator>gouthamkk</dc:creator>
      <dc:date>2016-07-25T03:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Median Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Median-Expression/m-p/1133541#M372390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expression had not a valid syntax - it should be look more like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;median(aggr(sum(Value), YourDimensions))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you really needed an aggr-function and if you will need to consider if possible set analysis conditions belong to inner or outer aggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2967"&gt;AGGR...&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2980"&gt;When should the Aggr() function NOT be used?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4418"&gt;Pitfalls of the Aggr function&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 05:17:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Median-Expression/m-p/1133541#M372390</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-07-25T05:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Median Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Median-Expression/m-p/1133542#M372391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You use the implicit aggregation function Only() when you don't specify on explicitly. And you need to add the set modifier to that aggregation too. So you must make the aggregation explicit:"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Median({&amp;lt;&lt;SPAN style="font-size: 13.33px;"&gt;empid=,branch=, &lt;SPAN style="font-size: 13.33px;"&gt;flag =, &lt;SPAN style="font-size: 13.33px;"&gt;position=&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;gt;}&amp;nbsp; aggr( &lt;STRONG&gt;only({&amp;lt;&lt;SPAN style="font-size: 13.33px;"&gt;empid=,branch=, &lt;SPAN style="font-size: 13.33px;"&gt;flag =, &lt;SPAN style="font-size: 13.33px;"&gt;position=&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;gt;}&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.33px;"&gt;&lt;STRONG&gt;weight)&lt;/STRONG&gt; ,&lt;SPAN style="font-size: 13.33px;"&gt;branch,&lt;SPAN style="font-size: 13.33px;"&gt;flag, &lt;SPAN style="font-size: 13.33px;"&gt;position&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to use sum() instead of only() if there are several weight values per combination of empid, branch, flag and position values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 06:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Median-Expression/m-p/1133542#M372391</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-07-25T06:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Median Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Median-Expression/m-p/1133543#M372392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;this is helpfull. Is there any way i could also add date dimesion so that it caluclates only for last 24 month excluding current month&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 11:25:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Median-Expression/m-p/1133543#M372392</guid>
      <dc:creator>gouthamkk</dc:creator>
      <dc:date>2016-07-25T11:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Median Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Median-Expression/m-p/1133544#M372393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's possible. Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;({&amp;lt;&lt;SPAN style="font-size: 13.33px;"&gt;empid=,branch=, &lt;SPAN style="font-size: 13.33px;"&gt;flag =, &lt;SPAN style="font-size: 13.33px;"&gt;position=, date={"=date=&amp;gt;$(=monthstart(max(date),-24)) and date&amp;lt;$(=monthstart(max(date)))"}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 11:39:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Median-Expression/m-p/1133544#M372393</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-07-25T11:39:02Z</dc:date>
    </item>
  </channel>
</rss>

