<?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: Problems with P() and filters in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1800242#M1211605</link>
    <description>&lt;P&gt;Didnt work neither ...&lt;/P&gt;</description>
    <pubDate>Fri, 16 Apr 2021 22:07:24 GMT</pubDate>
    <dc:creator>bentley32</dc:creator>
    <dc:date>2021-04-16T22:07:24Z</dc:date>
    <item>
      <title>Problems with P() and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1793816#M1210957</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;Let's say i do have 2 hierarchies, city and country&lt;/P&gt;&lt;P&gt;I am trying to create a measure which for each city will give me the avg sales for the whole country&lt;/P&gt;&lt;P&gt;I tried this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;= avg({$1&amp;lt;Country=p()&amp;gt;} Sales) and it worked&lt;/P&gt;&lt;P&gt;But whenever i do filter with a dimension that is not in the hierarchy, per exemple type of sales, it will bring also the sales of other countries since i am asking in my formula all the possible values of each filter ...&lt;/P&gt;&lt;P&gt;Then i tried this&amp;nbsp;avg({$1&amp;lt;Country, Type=p()&amp;gt;} Sales) and it worked again, but when i filter with the country, im getting again a wrong result with all the possible combinations of country and type ...&lt;/P&gt;&lt;P&gt;Do you have a trick to overcome this problem ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 18:06:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1793816#M1210957</guid>
      <dc:creator>bentley32</dc:creator>
      <dc:date>2021-03-23T18:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with P() and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1793838#M1210960</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've not seen P() used like that &amp;amp; $1 means use the previous selection, so confused as to what you mean by working.&lt;/P&gt;&lt;P&gt;From what you describe I would have expected to use something like avg(TOTAL &amp;lt;Country&amp;gt; Sales), meaning discount the Country when taking the average, but it really depends on what you are using this in (you might need an aggr to average an average).&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 19:06:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1793838#M1210960</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2021-03-23T19:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with P() and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1793842#M1210961</link>
      <description>&lt;P&gt;Hi, thanks for your help,&lt;/P&gt;&lt;P&gt;Doing the&amp;nbsp;&lt;SPAN&gt;avg(TOTAL &amp;lt;Country&amp;gt; Sales) i can't have the sales of the country related to the city when i am filtering by a city,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It would just give the result of the city ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 19:17:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1793842#M1210961</guid>
      <dc:creator>bentley32</dc:creator>
      <dc:date>2021-03-23T19:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with P() and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1793863#M1210962</link>
      <description>&lt;P&gt;Up ?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 21:13:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1793863#M1210962</guid>
      <dc:creator>bentley32</dc:creator>
      <dc:date>2021-03-23T21:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with P() and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1794204#M1211000</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How about;&lt;/P&gt;&lt;P&gt;avg(1)*avg({&amp;lt;City=&amp;gt;}TOTAL &amp;lt;Country&amp;gt; Sales)&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 19:15:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1794204#M1211000</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2021-03-24T19:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with P() and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1800242#M1211605</link>
      <description>&lt;P&gt;Didnt work neither ...&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 22:07:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1800242#M1211605</guid>
      <dc:creator>bentley32</dc:creator>
      <dc:date>2021-04-16T22:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with P() and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1802386#M1211819</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you are still looking for a solution you will need to share more, so above suggestion was based off toy application (script below), which gives following behavior;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="20210424_1.png" style="width: 634px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/53608iDB066C445B18B8A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="20210424_1.png" alt="20210424_1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="20210424_2.png" style="width: 589px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/53609iF71ED38FBF1D876F/image-size/large?v=v2&amp;amp;px=999" role="button" title="20210424_2.png" alt="20210424_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now that may or may not be what you want, if it is and it does not work then would need to understand more about your data model to make alternate suggestions.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;data:
Load * Inline [
City, Country, Type, Sales
London, UK, 1, 10
Birmingham, UK, 1, 15
London, UK, 2, 20
Birmingham, UK, 2, 30
Paris, France, 1, 40
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2021 16:28:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-P-and-filters/m-p/1802386#M1211819</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2021-04-24T16:28:51Z</dc:date>
    </item>
  </channel>
</rss>

