<?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: Can i add variables in expressions? if so how? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937740#M13091</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The syntax isn't right - instead of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... SID_MONTH={$('vMonthPreviousX12')} ...&lt;/P&gt;&lt;P&gt;it should look more so:&lt;/P&gt;&lt;P&gt;... SID_MONTH={'$(vMonthPreviousX12)'} ... // or&lt;/P&gt;&lt;P&gt;... SID_MONTH={"$(vMonthPreviousX12)"} ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Dec 2015 13:43:17 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2015-12-02T13:43:17Z</dc:date>
    <item>
      <title>Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937739#M13090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can i add variables in expressions? if so how?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am i doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;PRODUCT={"xxxxxxx"},SID_MONTH={$('vMonthPreviousX12')}&amp;gt;}Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//vMonthPreviousX12&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 13:34:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937739#M13090</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-02T13:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937740#M13091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The syntax isn't right - instead of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... SID_MONTH={$('vMonthPreviousX12')} ...&lt;/P&gt;&lt;P&gt;it should look more so:&lt;/P&gt;&lt;P&gt;... SID_MONTH={'$(vMonthPreviousX12)'} ... // or&lt;/P&gt;&lt;P&gt;... SID_MONTH={"$(vMonthPreviousX12)"} ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 13:43:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937740#M13091</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-12-02T13:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937741#M13092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the apostrophe is not valid in this expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thread about variables in load script:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/192968"&gt;Field not found - &amp;amp;lt;=&amp;amp;gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use variables In chart expression as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should check it at an easier expression, like: &lt;/P&gt;&lt;P&gt;=if($(vFoo)=1,'Some text','Other text')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 13:53:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937741#M13092</guid>
      <dc:creator>undergrinder</dc:creator>
      <dc:date>2015-12-02T13:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937742#M13093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried all those option still nothing, maybe the format of the variable has to be the same as the date field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 13:54:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937742#M13093</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-02T13:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937743#M13094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes this is right, not only the values must be matching also the formattings must be the same. This meant by month that &lt;STRONG&gt;Nov&lt;/STRONG&gt; wouldn't match with &lt;STRONG&gt;11&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 13:57:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937743#M13094</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-12-02T13:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937744#M13095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So what's the best formats to use?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 14:01:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937744#M13095</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-02T14:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937745#M13096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its also important (as of 2.1) to assess the syntax of&amp;nbsp; the expression behind your variable and whether that syntax is valid in the context of where you are trying to apply it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Related to that is whether the expression behind your variable has a leading '=' sign, which would tell Qlik to evaluate the expression before injecting the result into the expression, or evaluating within the context of the expression. Its different&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post the screenshot of the variable defiition for&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;vMonthPreviousX12 ? &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 14:04:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937745#M13096</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-12-02T14:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937746#M13097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this expression for a sample:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;count( {$ &amp;lt; [Days In Stock]={"&amp;gt;$(varHigh)"} &amp;gt;}[Vehicle ID]) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This document will give you all the insight you need about variables and its usage:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3406"&gt;The Magic of Variables&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 14:12:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937746#M13097</guid>
      <dc:creator>reddy-s</dc:creator>
      <dc:date>2015-12-02T14:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937747#M13098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here you go&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMonthPreviousX12 = month(MonthStart(today())-12);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i also tried this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMonthPreviousX12 = month(MonthStart(today())-12, YYYYMM);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the where clause Date field is called SID_MONTH and is formatted like this from the SQL warehouse 201509&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 14:17:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937747#M13098</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-02T14:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937748#M13099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Marcus Sommer was suggesting, to create data equivalency on both sides you may need to adjust SID_MONTH in the&amp;nbsp; load editor to calculate as a month() as well . Something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SID_MONTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(Date#(SID_MONTH,'YYYYMM')) as SID_MONTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After reloading you will know for sure that SID_MONTH is producing month() values in the same format as your variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also i think you need to change you variable. I suggest the addmonths() function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;LET vMonthPreviousX12 = month(MonthStart(today())-12);&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: 13px; line-height: 1.5em;"&gt;to&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;LET vMonthPreviousX12 = month(addmonths(today(),-11));&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 14:29:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937748#M13099</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-12-02T14:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937749#M13100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lak,&lt;/P&gt;&lt;P&gt;If you are using this in script try some thing like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let varPrev = year(today())&amp;amp;num(month(addmonths(today(),-1)));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load *;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM db.table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE field &amp;gt; '$(varPrev)';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 14:36:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937749#M13100</guid>
      <dc:creator>reddy-s</dc:creator>
      <dc:date>2015-12-02T14:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can i add variables in expressions? if so how?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937750#M13101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Guys, i'll try this later on or tomorrow and let you guys know how i get on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 14:40:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-i-add-variables-in-expressions-if-so-how/m-p/937750#M13101</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-02T14:40:43Z</dc:date>
    </item>
  </channel>
</rss>

