<?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 modifier in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-modifier/m-p/690811#M474687</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all, your syntax is missing the dollar sign expansion syntax (see help), you need to add $(= and a closing bracket.&lt;/P&gt;&lt;P&gt;Then you need to get the format of the equation equal, compare numbers with numbers or text with text. If Month is a text or a date field it will expect text on the right hand. In that case you will need to add quotation marks around, so '$(=....)'&lt;/P&gt;&lt;P&gt;Now you make sure the text is in the same format as the month field, if it's a date use the date function to format e.g.&lt;/P&gt;&lt;P&gt;sum({&amp;lt;MONTH= {'$(=Date(monthname(today(),-1),'MMM-YY'))'}&amp;gt;} Revenues)&lt;/P&gt;&lt;P&gt;you will need to adjust the 'MMM-YY' to your own date format&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Sep 2014 14:08:55 GMT</pubDate>
    <dc:creator>stigchel</dc:creator>
    <dc:date>2014-09-02T14:08:55Z</dc:date>
    <item>
      <title>Set analysis with variable modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-modifier/m-p/690808#M474684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I need you help in trying to find an expression that allows me to calculate the revenues for last month. I was thinking to use set analysis to do this, and it actually work when I put '08' in the formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;MONTH = {08}&amp;gt;} Revenues)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that '08' needs to be a variable according to todays date; it should look something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;MONTH = {(monthname(today(),-1)}&amp;gt;} Revenues)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it isn't working &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can somebody help??&lt;/P&gt;&lt;P&gt;Tx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 13:44:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-modifier/m-p/690808#M474684</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-02T13:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-modifier/m-p/690809#M474685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If you put&amp;nbsp; ' &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;monthname(today(),-1))&lt;/SPAN&gt;'&amp;nbsp; in a text box does it return 08 as well ?&amp;nbsp; That is key. Once you get the right expression you can use syntax like the following in the SET STATEMENT:&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;sum({&amp;lt;MONTH = {' $(= monthname(today(),-1)) '}&amp;gt;} Revenues) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 13:47:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-modifier/m-p/690809#M474685</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-09-02T13:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-modifier/m-p/690810#M474686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if MONTH is in MMM format.... i.e. Jan, Feb, Mar etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MONTH &lt;/SPAN&gt;= {"$(=SubField('$(MonthNames)',';',Month(Today())-1))"}&amp;gt;}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Revenues&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&amp;nbsp; if MONTH is in Numeric Format... i.e. 1, 2, 3 etc&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;MONTH = {"$(=Month(Today())-1)"}&amp;gt;}Revenues)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 13:53:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-modifier/m-p/690810#M474686</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-09-02T13:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-modifier/m-p/690811#M474687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all, your syntax is missing the dollar sign expansion syntax (see help), you need to add $(= and a closing bracket.&lt;/P&gt;&lt;P&gt;Then you need to get the format of the equation equal, compare numbers with numbers or text with text. If Month is a text or a date field it will expect text on the right hand. In that case you will need to add quotation marks around, so '$(=....)'&lt;/P&gt;&lt;P&gt;Now you make sure the text is in the same format as the month field, if it's a date use the date function to format e.g.&lt;/P&gt;&lt;P&gt;sum({&amp;lt;MONTH= {'$(=Date(monthname(today(),-1),'MMM-YY'))'}&amp;gt;} Revenues)&lt;/P&gt;&lt;P&gt;you will need to adjust the 'MMM-YY' to your own date format&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 14:08:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-modifier/m-p/690811#M474687</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2014-09-02T14:08:55Z</dc:date>
    </item>
  </channel>
</rss>

