<?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 Limiting possible field elements with Set Analysis - P()/E() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Limiting-possible-field-elements-with-Set-Analysis-P-E/m-p/1009117#M467964</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;This is admittedly not ground breaking, but it is worth sharing.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;My data set has many fields available, and I only want territories that are in the East and West regions. Filtering out the territories that are not in the East or West regions within the script is not an option.&amp;nbsp; So I must use some set analysis to handle this.&amp;nbsp; At first, one might think to use SUM({&amp;lt;Region={'East','West'} Sales&amp;gt;}.&amp;nbsp; The problem with this is that you wanted to see sales for just the East region, the chart would show for both East and West.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;What I really wanted was to limit the possible territories for those that fall in the East and West regions.&amp;nbsp; Using the P() function does exactly this.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SUM(&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;{&amp;lt;&lt;/STRONG&gt;&lt;/SPAN&gt;Region = &lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #0000ff;"&gt;P&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;&lt;/SPAN&gt;Region = &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;{'East','West'}&lt;SPAN style="color: #ff0000;"&gt;&amp;gt;}&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;gt;}&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sales&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Dimension on the table is Territory&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I can then create another chart to limit the possible territories to the North and South regions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SUM(&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;{&amp;lt;&lt;/STRONG&gt;&lt;/SPAN&gt;Region = &lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #0000ff;"&gt;P&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;&lt;/SPAN&gt;Region = &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;{'North','South'}&lt;SPAN style="color: #ff0000;"&gt;&amp;gt;}&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;gt;}&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sales&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Dimension on the table is Territory&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;The Exclusion E() can also be used to do the opposite.&amp;nbsp; You can to limit the territories tho those that do NOT fall into the East or West Regions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SUM(&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;{&amp;lt;&lt;/STRONG&gt;&lt;/SPAN&gt;Region = &lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #993366;"&gt;E&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;&lt;/SPAN&gt;Region = &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;{'East','West'}&lt;SPAN style="color: #ff0000;"&gt;&amp;gt;}&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;gt;}&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sales&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Dimension on the table is Territory&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;As said before, this is not earth shattering, but I think there are intermediate users out there that might find this technique useful.&amp;nbsp; The P() and E() functions come in handy at times.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Enjoy!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Emile&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Oct 2015 16:51:22 GMT</pubDate>
    <dc:creator>emiledavis</dc:creator>
    <dc:date>2015-10-06T16:51:22Z</dc:date>
    <item>
      <title>Limiting possible field elements with Set Analysis - P()/E()</title>
      <link>https://community.qlik.com/t5/QlikView/Limiting-possible-field-elements-with-Set-Analysis-P-E/m-p/1009117#M467964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;This is admittedly not ground breaking, but it is worth sharing.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;My data set has many fields available, and I only want territories that are in the East and West regions. Filtering out the territories that are not in the East or West regions within the script is not an option.&amp;nbsp; So I must use some set analysis to handle this.&amp;nbsp; At first, one might think to use SUM({&amp;lt;Region={'East','West'} Sales&amp;gt;}.&amp;nbsp; The problem with this is that you wanted to see sales for just the East region, the chart would show for both East and West.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;What I really wanted was to limit the possible territories for those that fall in the East and West regions.&amp;nbsp; Using the P() function does exactly this.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SUM(&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;{&amp;lt;&lt;/STRONG&gt;&lt;/SPAN&gt;Region = &lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #0000ff;"&gt;P&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;&lt;/SPAN&gt;Region = &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;{'East','West'}&lt;SPAN style="color: #ff0000;"&gt;&amp;gt;}&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;gt;}&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sales&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Dimension on the table is Territory&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I can then create another chart to limit the possible territories to the North and South regions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SUM(&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;{&amp;lt;&lt;/STRONG&gt;&lt;/SPAN&gt;Region = &lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #0000ff;"&gt;P&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;&lt;/SPAN&gt;Region = &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;{'North','South'}&lt;SPAN style="color: #ff0000;"&gt;&amp;gt;}&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;gt;}&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sales&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Dimension on the table is Territory&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;The Exclusion E() can also be used to do the opposite.&amp;nbsp; You can to limit the territories tho those that do NOT fall into the East or West Regions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SUM(&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;{&amp;lt;&lt;/STRONG&gt;&lt;/SPAN&gt;Region = &lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #993366;"&gt;E&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;&lt;/SPAN&gt;Region = &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;{'East','West'}&lt;SPAN style="color: #ff0000;"&gt;&amp;gt;}&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;gt;}&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sales&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Dimension on the table is Territory&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;As said before, this is not earth shattering, but I think there are intermediate users out there that might find this technique useful.&amp;nbsp; The P() and E() functions come in handy at times.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Enjoy!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Emile&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Oct 2015 16:51:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Limiting-possible-field-elements-with-Set-Analysis-P-E/m-p/1009117#M467964</guid>
      <dc:creator>emiledavis</dc:creator>
      <dc:date>2015-10-06T16:51:22Z</dc:date>
    </item>
  </channel>
</rss>

