<?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: Finding Medians using Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Finding-Medians-using-Set-Analysis/m-p/880881#M307391</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you may need to ignore the selection in both the SUM and the MEDIAN:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Num(Median({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Quarter_Label1=&lt;/SPAN&gt;&amp;gt;}Aggr(Sum({$&amp;lt; WON_LOST={'Won'}, Quarter_Label1=, CLOSE_DATE={"&amp;gt;=$(v_minPrior4Qtr)&amp;lt;$(=$(v_maxCurrentQtr)+1)"}&amp;gt;} SALESPRICE), OPPQTR)), '#,##0.0')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Let me know if that works out for you.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jul 2015 16:15:38 GMT</pubDate>
    <dc:creator>Nicole-Smith</dc:creator>
    <dc:date>2015-07-15T16:15:38Z</dc:date>
    <item>
      <title>Finding Medians using Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-Medians-using-Set-Analysis/m-p/880880#M307390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with making the Set Analysis ignore filters that are set for display when trying to calculate the Median won sales values to display as a column in a pivot table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Original expression that was being affected by the selection of the Quarter_Label1 value, the vMinPrior4Qtr and v_maxCurrentQtr are date variables covering a 12 month period:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Num(Median(Aggr(Sum({$&amp;lt; WON_LOST={'Won'}, Quarter_Label1=, CLOSE_DATE={"&amp;gt;=$(v_minPrior4Qtr)&amp;lt;$(=$(v_maxCurrentQtr)+1)"}&amp;gt;} SALESPRICE), OPPQTR)), '#,##0.0')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each OPPQTR is a unique reference to a sales opportunity, to which multiple product line items can be associated with a SALESPRICE value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found from some research that the p() function should be used to overcome the fact that the changes are ignored in the aggregate.but I cannot make this work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Revised attempt using the p() function in the Set Analysis, but this is still affected by the selection of Quarter_Label1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Num(Median(Aggr(Sum({$&amp;lt;OPPQTR = p( {$&amp;lt;WON_LOST={'Won'}, Quarter_Label1=, CLOSE_DATE={"&amp;gt;=$(v_minPrior4Qtr)&amp;lt;$(=$(v_maxCurrentQtr)+1)"}&amp;gt;} OPPQTR)&amp;gt;} SALESPRICE), OPPQTR)), '#,##0.0')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Elsewhere in my table, this expression shows the total won value and works fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;WON_LOST={'Won'},&amp;nbsp; Quarter_Label1=, CLOSE_DATE={"&amp;gt;=$(v_minPrior4Qtr)&amp;lt;$(=$(v_maxCurrentQtr)+1)"}&amp;gt;} SALESPRICE))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 13:30:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-Medians-using-Set-Analysis/m-p/880880#M307390</guid>
      <dc:creator />
      <dc:date>2015-07-15T13:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Medians using Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-Medians-using-Set-Analysis/m-p/880881#M307391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you may need to ignore the selection in both the SUM and the MEDIAN:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Num(Median({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Quarter_Label1=&lt;/SPAN&gt;&amp;gt;}Aggr(Sum({$&amp;lt; WON_LOST={'Won'}, Quarter_Label1=, CLOSE_DATE={"&amp;gt;=$(v_minPrior4Qtr)&amp;lt;$(=$(v_maxCurrentQtr)+1)"}&amp;gt;} SALESPRICE), OPPQTR)), '#,##0.0')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Let me know if that works out for you.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 16:15:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-Medians-using-Set-Analysis/m-p/880881#M307391</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2015-07-15T16:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Medians using Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-Medians-using-Set-Analysis/m-p/880882#M307392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This has resolved my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 16:26:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-Medians-using-Set-Analysis/m-p/880882#M307392</guid>
      <dc:creator />
      <dc:date>2015-07-15T16:26:15Z</dc:date>
    </item>
  </channel>
</rss>

