<?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: Using a variable in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/1899592#M1217690</link>
    <description>&lt;P&gt;Super Awesome. I was so baffled as to why my text entry was not working lol. Thanks for the help&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2022 21:12:06 GMT</pubDate>
    <dc:creator>ZoeM</dc:creator>
    <dc:date>2022-03-02T21:12:06Z</dc:date>
    <item>
      <title>Using a variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731828#M676176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have set a Current Month variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vCurrentMonth= Month(Today(2));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which works in a text object, it shows "Jun" which is what I am looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression I use the variable in is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count( &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;{$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;EndMonth =&amp;nbsp; { '$(vCurrentMonth)' } &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;[Assignment ID] )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which results in zeros. But if I type Jun in place of the variable I get the correct data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count( &lt;SPAN style="font-size: 10pt;"&gt;{$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;EndMonth = { '=$(vCurrentMonth)' } &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;[Assignment ID] )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shows all data as if there was no set analysis&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;=Count( &lt;SPAN style="font-size: 10pt;"&gt;{$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;EndMonth = { ='$(vCurrentMonth)' } &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;[Assignment ID] )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; null values&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;=Count( &lt;SPAN style="font-size: 10pt;"&gt;{$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;EndMonth = { $('vCurrentMonth') } &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;[Assignment ID] )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; null values&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;=Count( &lt;SPAN style="font-size: 10pt;"&gt;{$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;EndMonth = { "$(vCurrentMonth)" } &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;[Assignment ID] )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; null values&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;I'm all out of ideas for why this isn't working. Can anyone see a mistake in the syntax or have any insight for why this variable is not working.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;Thanks,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 19:12:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731828#M676176</guid>
      <dc:creator />
      <dc:date>2014-06-23T19:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731829#M676177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.727272033691406px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.727272033691406px;"&gt;Count( &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;{$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;EndMonth = { '$(=vCurrentMonth)' } &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Assignment ID] )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hope this helps!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 19:14:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731829#M676177</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-06-23T19:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731830#M676178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this&lt;/P&gt;&lt;P&gt;=count({$ &amp;lt;Month={'$(vCurrentMonth)'}&amp;gt;} &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Assignment ID] &lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;and this&lt;/P&gt;&lt;P&gt;=count({$ &amp;lt;Month={$(vCurrentMonth)}&amp;gt;} &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Assignment ID] &lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;should work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is your variable (ctrl+alt+v)&lt;/P&gt;&lt;P&gt;=Month(Today(2))&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;Month(Today(2))&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 19:23:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731830#M676178</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-06-23T19:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731831#M676179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's another one you can try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Count( &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;{$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;EndMonth = {'$(=$(vCurrentMonth)) } &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Assignment ID] )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;As &lt;A href="https://community.qlik.com/qlik-users/10670"&gt;Massimo Grossi&lt;/A&gt; brings up, having or not having the equal sign in the declaration of the variable will affect your expression. The above should work if it does not have the equal sign. The others listed should work if it has the equal sign&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 19:42:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731831#M676179</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-06-23T19:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731832#M676180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The variable does not include the equal sign.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script: SET vCurrentMonth= Month(Today(2));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it best practice to include the equal sign as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example: SET vCurrentMonth= =Month(Today(2));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 19:53:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731832#M676180</guid>
      <dc:creator />
      <dc:date>2014-06-23T19:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731833#M676181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your answer works and, as you said, Massimo's answer works if I change the variable to have an equal sign.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vCurrentMonth= =Month(Today(2));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However once I add the value sign my text object no longer displays the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression: =$(vCurrentMonth) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It used to display Jun, now it produces a null value "-"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 20:02:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731833#M676181</guid>
      <dc:creator />
      <dc:date>2014-06-23T20:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731834#M676182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll want to use the keyword LET in your script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;LET vCurrentMonth= Month(Today(2));&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;This will put the value 'Jun" into your variable. Then your formula:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=Count( &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;{$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;EndMonth =&amp;nbsp; {$(vCurrentMonth)} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Assignment ID] )&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;will work. Then you can just have the formula for your textbox be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=vCurrentMonth&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Hope this helps!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 20:07:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/731834#M676182</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-06-23T20:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/1899592#M1217690</link>
      <description>&lt;P&gt;Super Awesome. I was so baffled as to why my text entry was not working lol. Thanks for the help&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 21:12:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-set-analysis/m-p/1899592#M1217690</guid>
      <dc:creator>ZoeM</dc:creator>
      <dc:date>2022-03-02T21:12:06Z</dc:date>
    </item>
  </channel>
</rss>

