<?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: Set analysis with variable as &amp;quot;filter&amp;quot; in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-as-quot-filter-quot/m-p/1410375#M804549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow! Thank you Mark &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; 1 shot 1 hit!&lt;/P&gt;&lt;P&gt;This totally made the job! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Nov 2017 14:33:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-11-03T14:33:34Z</dc:date>
    <item>
      <title>Set analysis with variable as "filter"</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-as-quot-filter-quot/m-p/1410373#M804547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I 've a qlikview dashboard with many metrics that do the same operations but to different fields. To avoid repeating lines of code i organize it with variables with parameters. I am trying to use one of this parameters which is using some calculations but it is not working. Following i pass a sample of how it looks:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;THIS IS WORKING:&lt;/SPAN&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt;"&gt;variables:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;vDelivery_CSAT_DSAT&lt;STRONG&gt; = &lt;/STRONG&gt;sum({&amp;lt;$1&amp;gt;} $2) / sum({&amp;lt;$1&amp;gt;} FIELD_CSAT_DSAT_TOTAL_FLAG)&lt;/P&gt;&lt;P&gt;vfilter_1= [Region]={'EUROPE'}&lt;/P&gt;&lt;P&gt;vfilter_2= [Region]={'USA'}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the &lt;STRONG&gt;expressions&lt;/STRONG&gt; I use it like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EXP 1: &lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; $(vDelivery_CSAT_DSAT($(vfilter1),FIELD_CSAT_FLAG))&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EXP 2: &lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;$(vDelivery_CSAT_DSAT($(vfilter2),FIELD_DSAT_FLAG))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;THIS IS NOT WORKING&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;What i want and can't accomplish is using in the filter some calculations just like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;vfilter3 = [DATE]={ "&amp;gt;=$(=addmoths(today(),-12))"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Nevertheless this works when using it directly in the expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sum({&amp;lt;&lt;SPAN style="font-size: 13.3333px;"&gt;[DATE]={ "&amp;gt;=$(=addmoths(today(),-12))"}&lt;/SPAN&gt;&amp;gt;} &lt;SPAN style="font-size: 13.3333px;"&gt;FIELD_DSAT_FLAG&lt;/SPAN&gt;)&amp;nbsp; / &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sum({&amp;lt;&lt;SPAN style="font-size: 13.3333px;"&gt;[DATE]={"&amp;gt;=$(=addmoths(today(),-12))"}&lt;/SPAN&gt;&amp;gt;}FIELD_CSAT_DSAT_TOTAL_FLAG)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;How could i do it? As said before, i need to do it like this becose there are a lot of metrics that use the same calculations and i want to save code and lines.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks!! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-as-quot-filter-quot/m-p/1410373#M804547</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable as "filter"</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-as-quot-filter-quot/m-p/1410374#M804548</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;Have you tried it with out the dollar expansions, so&lt;/P&gt;&lt;P&gt;$(vDelivery_CSAT_DSAT(vfilter1,FIELD_CSAT_FLAG))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 14:18:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-as-quot-filter-quot/m-p/1410374#M804548</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2017-11-03T14:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable as "filter"</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-as-quot-filter-quot/m-p/1410375#M804549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow! Thank you Mark &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; 1 shot 1 hit!&lt;/P&gt;&lt;P&gt;This totally made the job! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 14:33:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-as-quot-filter-quot/m-p/1410375#M804549</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-03T14:33:34Z</dc:date>
    </item>
  </channel>
</rss>

