<?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: Can we use an expression as {'filter'} for set analysis? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Can-we-use-an-expression-as-filter-for-set-analysis/m-p/387876#M485921</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically you can't. Set analysis is for making/modifying selections at expression level, and you can't select an expression result. It has to be a field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can achieve what you want with advanced aggregation, like this:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13667136036425819" jivemacro_uid="_13667136036425819"&gt;&lt;P&gt;=Count(Aggr(If(Sum(COS)*Sum(Volume)*Sum(Investment)/1000&amp;gt;300000,1,Null()), Group))&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Apr 2013 09:37:16 GMT</pubDate>
    <dc:creator>kuba_michalik</dc:creator>
    <dc:date>2013-04-23T09:37:16Z</dc:date>
    <item>
      <title>Can we use an expression as {'filter'} for set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-we-use-an-expression-as-filter-for-set-analysis/m-p/387875#M485920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to ask for your help regarding my problem. My client will be very happy if you can help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question: Can we use an expression as filter for set analysis?&lt;/P&gt;&lt;P&gt;To explain my question, here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="71" style="width: 439px; height: 65px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl70" height="17" width="64"&gt;Group&lt;/TD&gt;&lt;TD class="xl70" width="64"&gt;Volume&lt;/TD&gt;&lt;TD class="xl70" width="64"&gt;Investment&lt;/TD&gt;&lt;TD class="xl70" width="64"&gt;COS&lt;/TD&gt;&lt;TD class="xl70" width="64"&gt;ASP&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl70" height="17"&gt;A&lt;/TD&gt;&lt;TD align="right"&gt;1000&lt;/TD&gt;&lt;TD align="right"&gt;1200&lt;/TD&gt;&lt;TD align="right"&gt;50&lt;/TD&gt;&lt;TD align="right"&gt;60000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl70" height="17"&gt;B&lt;/TD&gt;&lt;TD align="right"&gt;1500&lt;/TD&gt;&lt;TD align="right"&gt;3000&lt;/TD&gt;&lt;TD align="right"&gt;70&lt;/TD&gt;&lt;TD align="right"&gt;315000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl70" height="17"&gt;C&lt;/TD&gt;&lt;TD align="right"&gt;1750&lt;/TD&gt;&lt;TD align="right"&gt;3800&lt;/TD&gt;&lt;TD align="right"&gt;100&lt;/TD&gt;&lt;TD align="right"&gt;665000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Formula:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ASP = COS * Volume * Investment / 1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Objective:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;To count the groups with ASP &amp;gt; 300000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The catch:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Each column came from different tables, they cannot be joined / concat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally, this expression below should fix the issue:&lt;/P&gt;&lt;P&gt;Count ({$&amp;lt;ASP={&amp;gt;300000}&amp;gt;} DISTINCT Group)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as I said before, they came from different tables so using ASP =&amp;nbsp; COS * Volume * Investment / 1000 in the load script does not work.&lt;/P&gt;&lt;P&gt;This is actually what I have in mind although the output is wrong:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If (COS * Volume * Investment / 1000 &amp;gt; 300000, Count (DISTINCT Group))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;We can use an expression in IF statement to filter the result but the question is: Can we use an expression as filter in a set expression?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Also, it would be great if you can give the correct expression to get the groups with ASP &amp;gt; 300000.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thank you very much and Godbless! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Gerald&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 02:39:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-we-use-an-expression-as-filter-for-set-analysis/m-p/387875#M485920</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-23T02:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use an expression as {'filter'} for set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-we-use-an-expression-as-filter-for-set-analysis/m-p/387876#M485921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically you can't. Set analysis is for making/modifying selections at expression level, and you can't select an expression result. It has to be a field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can achieve what you want with advanced aggregation, like this:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13667136036425819" jivemacro_uid="_13667136036425819"&gt;&lt;P&gt;=Count(Aggr(If(Sum(COS)*Sum(Volume)*Sum(Investment)/1000&amp;gt;300000,1,Null()), Group))&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 09:37:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-we-use-an-expression-as-filter-for-set-analysis/m-p/387876#M485921</guid>
      <dc:creator>kuba_michalik</dc:creator>
      <dc:date>2013-04-23T09:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use an expression as {'filter'} for set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-we-use-an-expression-as-filter-for-set-analysis/m-p/387877#M485922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was smooth Kuba_Michalik &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; I tried your suggestion and it worked!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And thank you for helping me understood that expressions can't be used as filter in set expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Godbless you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 02:10:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-we-use-an-expression-as-filter-for-set-analysis/m-p/387877#M485922</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-24T02:10:09Z</dc:date>
    </item>
  </channel>
</rss>

