<?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 Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/1917900#M1218413</link>
    <description>&lt;P&gt;First thing to do is to see exactly what value&amp;nbsp;&lt;EM&gt;$(vG.LastWeek) holds by placing a text box onto your page and adding&amp;nbsp;&lt;BR /&gt;&lt;/EM&gt;=&lt;EM&gt;$(vG.LastWeek)&lt;/EM&gt;&lt;BR /&gt;remember the equals sign before it&lt;BR /&gt;Based on that result - assuming it returns a single value like 24 then you should be able to use your code without double quotes and double dollar notation because numeric values do NOT require quotes&lt;BR /&gt;ie.&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;(Sum({$&amp;lt;YearWeek={$(vG.LastWeek)}&amp;gt;}($(vExp.OQ))-($(vExp.DQ))))&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;e.g. if &lt;EM&gt;$(vG.LastWeek) &lt;/EM&gt; returns a string like "week24" then you need single quotes&lt;BR /&gt;&lt;EM&gt;(Sum({$&amp;lt;YearWeek={'$(vG.LastWeek)'}&amp;gt;}($(vExp.OQ))-($(vExp.DQ))))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;i.e. if you want to select where less than or equal to the max week (assuming it returned a number like 24) then you need the double quotes to change the set analysis into a "search"&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;(Sum({$&amp;lt;YearWeek={"&amp;lt;=$(vG.LastWeek)"}&amp;gt;}($(vExp.OQ))-($(vExp.DQ))))&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;Lastly check other of the other two variable are in fact returning the values you are expecting them too. (same way with a text box)&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2022 09:26:08 GMT</pubDate>
    <dc:creator>njmaehler</dc:creator>
    <dc:date>2022-04-13T09:26:08Z</dc:date>
    <item>
      <title>Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/1917888#M1218409</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Need help with set expression for totaling a variable that has to be limited by another variable&amp;nbsp;&lt;/P&gt;
&lt;P&gt;total of&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; ($(vExp.OQ))-($(vExp.DQ))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;To be limited by a varaible&amp;nbsp;&amp;nbsp; which is related to the dimension YearWeek&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vG.LastWeek&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;My set expression looks like this but is not working&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;(Sum({$&amp;lt;YearWeek={"$(=$(vG.LastWeek))"}&amp;gt;}($(vExp.OQ))-($(vExp.DQ))))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;TIA&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 08:50:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/1917888#M1218409</guid>
      <dc:creator>_VAT</dc:creator>
      <dc:date>2022-04-13T08:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/1917900#M1218413</link>
      <description>&lt;P&gt;First thing to do is to see exactly what value&amp;nbsp;&lt;EM&gt;$(vG.LastWeek) holds by placing a text box onto your page and adding&amp;nbsp;&lt;BR /&gt;&lt;/EM&gt;=&lt;EM&gt;$(vG.LastWeek)&lt;/EM&gt;&lt;BR /&gt;remember the equals sign before it&lt;BR /&gt;Based on that result - assuming it returns a single value like 24 then you should be able to use your code without double quotes and double dollar notation because numeric values do NOT require quotes&lt;BR /&gt;ie.&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;(Sum({$&amp;lt;YearWeek={$(vG.LastWeek)}&amp;gt;}($(vExp.OQ))-($(vExp.DQ))))&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;e.g. if &lt;EM&gt;$(vG.LastWeek) &lt;/EM&gt; returns a string like "week24" then you need single quotes&lt;BR /&gt;&lt;EM&gt;(Sum({$&amp;lt;YearWeek={'$(vG.LastWeek)'}&amp;gt;}($(vExp.OQ))-($(vExp.DQ))))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;i.e. if you want to select where less than or equal to the max week (assuming it returned a number like 24) then you need the double quotes to change the set analysis into a "search"&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;(Sum({$&amp;lt;YearWeek={"&amp;lt;=$(vG.LastWeek)"}&amp;gt;}($(vExp.OQ))-($(vExp.DQ))))&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;Lastly check other of the other two variable are in fact returning the values you are expecting them too. (same way with a text box)&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 09:26:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/1917900#M1218413</guid>
      <dc:creator>njmaehler</dc:creator>
      <dc:date>2022-04-13T09:26:08Z</dc:date>
    </item>
  </channel>
</rss>

