<?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: Apply a filter to a variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Apply-a-filter-to-a-variable/m-p/1645149#M447478</link>
    <description>&lt;P&gt;Hi JGMD,&lt;/P&gt;&lt;P&gt;I want to avoid changing the script.&amp;nbsp; I want to know if there is a way to change the variable in the front end keeping the back-end untouched.&amp;nbsp; So the question is if there is a way to apply further filtering in a variable already calculated?&lt;/P&gt;&lt;P&gt;If I'm using $(vSalesCur), how can I wrap it around a new expression that allows me to add a new filter to it?&lt;/P&gt;&lt;P&gt;Something like =(&amp;lt;$(vSalesCur), Month=&amp;gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Nov 2019 06:10:09 GMT</pubDate>
    <dc:creator>FleetingImage</dc:creator>
    <dc:date>2019-11-11T06:10:09Z</dc:date>
    <item>
      <title>Apply a filter to a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Apply-a-filter-to-a-variable/m-p/1642384#M447281</link>
      <description>&lt;P&gt;I created this variable in the load script:&lt;/P&gt;&lt;P&gt;set vSaleCur = sum( {&amp;lt;#(vFlag) = {'1'}, Actual_only = {'Yes'}, Comparative=, Year = {#(=#(vMaxYear))}&amp;gt;} SALES);&lt;/P&gt;&lt;P&gt;let vSaleCur = replace('$(vSaleCur)', '#', chr(36));&lt;/P&gt;&lt;P&gt;Now I'm using it in a chart as en expression, like this:&lt;/P&gt;&lt;P&gt;=$(vSalesCur)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Now I need to apply a new filter when using the variable as an expression in the chart so it disregards the filter by month, something like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=sum(&amp;nbsp;{&amp;lt;Month=&amp;gt;} $(vSalesCur))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I do not want to add the filter when creating the variable and I do not want to create a new variable with the new filter included because this is one example that I need to do with a lot of other variables&lt;/P&gt;&lt;P&gt;So...&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;NOT THIS:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;set vSaleCur = sum( {&amp;lt;#(vFlag) = {'1'}, Actual_only = {'Yes'}, Comparative=, &lt;FONT color="#0000FF"&gt;Month=&lt;/FONT&gt;, Year = {#(=#(vMaxYear))}&amp;gt;} SALES);&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;NOT THIS EITHER:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;set &lt;FONT color="#0000FF"&gt;vSaleCurNew&lt;/FONT&gt; = sum( {&amp;lt;#(vFlag) = {'1'}, Actual_only = {'Yes'}, Comparative=, &lt;FONT color="#0000FF"&gt;Month=&lt;/FONT&gt;, Year = {#(=#(vMaxYear))}&amp;gt;} SALES);&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:46:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Apply-a-filter-to-a-variable/m-p/1642384#M447281</guid>
      <dc:creator>FleetingImage</dc:creator>
      <dc:date>2024-11-16T19:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a filter to a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Apply-a-filter-to-a-variable/m-p/1642390#M447282</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Script&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;set vSaleCur = sum({&amp;lt;#(vFlag) = {'1'}, Actual_only = {'Yes'}, Comparative =, Year = {#(=#(vMaxYear))} &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;#(=replace('#1', '|', ','))&lt;/FONT&gt;&lt;/STRONG&gt;&amp;gt;} SALES);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;let vSaleCur = replace('$(vSaleCur)', '#', chr(36));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Front End&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Adding the set modifier that &lt;STRONG&gt;ignores&lt;/STRONG&gt; the &lt;STRONG&gt;selections&lt;/STRONG&gt; made on the &lt;STRONG&gt;Month&lt;/STRONG&gt; field...&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$(vSaleCur(&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;| Month =&lt;/STRONG&gt;&lt;/FONT&gt;))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Without adding additional set modifiers...&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$(vSaleCur( ))&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 06:06:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Apply-a-filter-to-a-variable/m-p/1642390#M447282</guid>
      <dc:creator>JGMDataAnalysis</dc:creator>
      <dc:date>2019-11-04T06:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a filter to a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Apply-a-filter-to-a-variable/m-p/1645149#M447478</link>
      <description>&lt;P&gt;Hi JGMD,&lt;/P&gt;&lt;P&gt;I want to avoid changing the script.&amp;nbsp; I want to know if there is a way to change the variable in the front end keeping the back-end untouched.&amp;nbsp; So the question is if there is a way to apply further filtering in a variable already calculated?&lt;/P&gt;&lt;P&gt;If I'm using $(vSalesCur), how can I wrap it around a new expression that allows me to add a new filter to it?&lt;/P&gt;&lt;P&gt;Something like =(&amp;lt;$(vSalesCur), Month=&amp;gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 06:10:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Apply-a-filter-to-a-variable/m-p/1645149#M447478</guid>
      <dc:creator>FleetingImage</dc:creator>
      <dc:date>2019-11-11T06:10:09Z</dc:date>
    </item>
  </channel>
</rss>

