<?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: Seeking correct syntax when using variable as constraint in set analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Seeking-correct-syntax-when-using-variable-as-constraint-in-set/m-p/1245956#M24869</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;You should put an equal sign so that the variable calculates &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;currently it is comparing it with a string Num(Month(Today(1)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried changing your variable in the script as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="img2.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/156920_img2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it computes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="img3.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/156921_img3.PNG" style="height: 378px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Mar 2017 01:20:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-03-21T01:20:58Z</dc:date>
    <item>
      <title>Seeking correct syntax when using variable as constraint in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Seeking-correct-syntax-when-using-variable-as-constraint-in-set/m-p/1245955#M24868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Community&lt;/P&gt;&lt;P&gt;I'm using Qlik Sense 3.1 SR4 here; I'm aiming for something of a YTD calculation, based on the Year up to the point the data is loaded and it's being plotted in a stacked bar chart in comparison with previous years.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have EventDate values in the data and from this I'm deriving EDateNumMonth from Num(Month(EventDate)), giving a number value for Month in each data row. Meanwhile, a control variable, vEDateNumMonthToday is set in the load script; &lt;SPAN style="font-size: 13.3333px;"&gt;Let's say we're in March,&lt;/SPAN&gt; so 3 then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in Qlikview (v11) I used an expression logic that ran like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;FieldNumMonth={'&amp;lt;=$(vTheCurrentMonth)'}&amp;gt;}RCounter).&lt;/P&gt;&lt;P&gt;This worked great and provided a YTD total for each year present in the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to employ the same approach in our QlikSense rendition, but it seems something is skewed.&lt;/P&gt;&lt;P&gt;If I hard code the limitation, as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;sum({&amp;lt;EDateNumMonth={'&amp;lt;=3'}&amp;gt;}RC)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;or&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;sum({&amp;lt;EDateNumMonth={'&amp;gt;=1&amp;lt;=3'}&amp;gt;}RC)&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;everything is fine - all adds up as it should.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As soon as I add a dollar expansion to the set analysis:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;EDateNumMonth={'&amp;lt;=$(vEDateNumMonthToday)'}&amp;gt;}RC) - the columns disappear, or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;EDateNumMonth={'&amp;gt;=1&amp;lt;=$(vEDateNumMonthToday)'}&amp;gt;}RC) - the columns display the total for the whole year!&lt;/P&gt;&lt;P&gt;Uuh?&lt;/P&gt;&lt;P&gt;Am I missing something here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@MichaelTarallo, or other community colleagues; &lt;SPAN style="font-size: 13.3333px;"&gt;Any constructive suggestions would be most welcome.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Graham&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 23:51:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Seeking-correct-syntax-when-using-variable-as-constraint-in-set/m-p/1245955#M24868</guid>
      <dc:creator>graham-crooks</dc:creator>
      <dc:date>2017-03-20T23:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking correct syntax when using variable as constraint in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Seeking-correct-syntax-when-using-variable-as-constraint-in-set/m-p/1245956#M24869</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;You should put an equal sign so that the variable calculates &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;currently it is comparing it with a string Num(Month(Today(1)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried changing your variable in the script as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="img2.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/156920_img2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it computes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="img3.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/156921_img3.PNG" style="height: 378px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 01:20:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Seeking-correct-syntax-when-using-variable-as-constraint-in-set/m-p/1245956#M24869</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-21T01:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking correct syntax when using variable as constraint in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Seeking-correct-syntax-when-using-variable-as-constraint-in-set/m-p/1245957#M24870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or even a dollar sign expansion within the dollar sign expansion can work also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;EDateNumMonth={'&amp;gt;=1&amp;lt;=$(&lt;SPAN style="color: #ff0000;"&gt;=$(&lt;/SPAN&gt;vEDateNumMonthToday&lt;SPAN style="color: #ff0000;"&gt;)&lt;/SPAN&gt;)'}&amp;gt;}RC)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 02:10:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Seeking-correct-syntax-when-using-variable-as-constraint-in-set/m-p/1245957#M24870</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-21T02:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking correct syntax when using variable as constraint in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Seeking-correct-syntax-when-using-variable-as-constraint-in-set/m-p/1245958#M24871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hey, Thank you for that insight. More attention to LET and SET would probably have been useful when I wrote the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 10:57:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Seeking-correct-syntax-when-using-variable-as-constraint-in-set/m-p/1245958#M24871</guid>
      <dc:creator>graham-crooks</dc:creator>
      <dc:date>2017-03-28T10:57:06Z</dc:date>
    </item>
  </channel>
</rss>

