<?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 How to combine Variable and fields in an expression? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208593#M501579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Is $1 the name of a variable or a field?, In any case, "less than or equal to" works as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum({&amp;lt; FieldName = {'&amp;gt;=$(=Date(&lt;B&gt;$(vVariableFrom)&lt;/B&gt;)&amp;lt;=$(=Date$(vVariableTo))'} &amp;gt;} Amount)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;In bold, calling the variable "vVariableFrom". Dolar expansion may be or may be not needed.&lt;/P&gt;&lt;P&gt;Underscored calling a function $(=Function(whatever)). The syntax is always like this.&lt;/P&gt;&lt;P&gt;I've single quoted the value since I want to use a literal. However, quoting is not needed for numbers (or for a variable which will return a number)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum({&amp;lt; Year = {$(vCurrentYear)} &amp;gt;} Amount)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;If you are going to use searchable values, then use the double quote&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum({&amp;lt; Year = {"20*"} &amp;gt;} Amount)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Dec 2010 15:54:28 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2010-12-03T15:54:28Z</dc:date>
    <item>
      <title>How to combine Variable and fields in an expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208589#M501575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like to do this:&lt;/P&gt;&lt;H4&gt;=sum({&amp;lt;fin_PORTFOLIO=, $(vMTD_PART( $(vAP), $(vFYEAR) ))&amp;gt;}($(vMeasure)))&lt;/H4&gt;&lt;P&gt;Variable is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;SET vMTD_PART = AP={$1},F_YEAR={$2},fin_SalesGroup={'SKU'}&lt;/H3&gt;&lt;H3&gt;How can I do this?&lt;/H3&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Dec 2010 10:56:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208589#M501575</guid>
      <dc:creator />
      <dc:date>2010-12-01T10:56:11Z</dc:date>
    </item>
    <item>
      <title>How to combine Variable and fields in an expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208590#M501576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. In the GUI create variables vAP and vFYEAR in an inputbox to make then dynamic.&lt;/P&gt;&lt;P&gt;2. Then create a variable vMTD_PART as being&lt;/P&gt;&lt;P&gt;='AP={$(vAP)},F_YEAR={$(vFYEAR)},fin_SalesGroup={'&amp;amp;chr(39)&amp;amp;'SKU'&amp;amp;chr(39)&amp;amp;'}'&lt;/P&gt;&lt;P&gt;(Note the use of chr(39) for single quotes)&lt;/P&gt;&lt;P&gt;3. In your expression put&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;fin_PORTFOLIO=, $(vMTD_PART)&amp;gt;} ($(vMeasure)))&lt;/P&gt;&lt;P&gt;I recommend testing each step in a text object.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Dec 2010 23:21:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208590#M501576</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-12-01T23:21:22Z</dc:date>
    </item>
    <item>
      <title>How to combine Variable and fields in an expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208591#M501577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great, thanks, it works for "=" Assign, but it does not work for less than or greater than, i.e:&lt;/P&gt;&lt;P&gt;does not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;='AP={"&amp;lt;=$(=$1)"},F_YEAR={$2},fin_SalesGroup={'&amp;amp;chr(39)&amp;amp;'SKU'&amp;amp;chr(39)&amp;amp;'}'&lt;/H3&gt;&lt;P&gt;What is wrong hear? this is a YTD function which should be range from month 1 to $1&lt;/P&gt;&lt;P&gt;The variable nightmare continues....&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 15:35:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208591#M501577</guid>
      <dc:creator />
      <dc:date>2010-12-03T15:35:40Z</dc:date>
    </item>
    <item>
      <title>How to combine Variable and fields in an expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208592#M501578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this, this doen't work either:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4&gt;='AP={'&amp;amp;chr(34)&amp;amp;'&amp;lt;=$(=$1)'&amp;amp;chr(34)&amp;amp;'},F_YEAR={$2},fin_SalesGroup={'&amp;amp;chr(39)&amp;amp;'SKU'&amp;amp;chr(39)&amp;amp;'}&amp;gt;}'&lt;/H4&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 15:46:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208592#M501578</guid>
      <dc:creator />
      <dc:date>2010-12-03T15:46:24Z</dc:date>
    </item>
    <item>
      <title>How to combine Variable and fields in an expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208593#M501579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Is $1 the name of a variable or a field?, In any case, "less than or equal to" works as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum({&amp;lt; FieldName = {'&amp;gt;=$(=Date(&lt;B&gt;$(vVariableFrom)&lt;/B&gt;)&amp;lt;=$(=Date$(vVariableTo))'} &amp;gt;} Amount)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;In bold, calling the variable "vVariableFrom". Dolar expansion may be or may be not needed.&lt;/P&gt;&lt;P&gt;Underscored calling a function $(=Function(whatever)). The syntax is always like this.&lt;/P&gt;&lt;P&gt;I've single quoted the value since I want to use a literal. However, quoting is not needed for numbers (or for a variable which will return a number)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum({&amp;lt; Year = {$(vCurrentYear)} &amp;gt;} Amount)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;If you are going to use searchable values, then use the double quote&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum({&amp;lt; Year = {"20*"} &amp;gt;} Amount)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 15:54:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208593#M501579</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-12-03T15:54:28Z</dc:date>
    </item>
    <item>
      <title>How to combine Variable and fields in an expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208594#M501580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok, so far so good, still does not work.&lt;/P&gt;&lt;P&gt;What about your example:&lt;/P&gt;&lt;H4 style="margin:0px;"&gt;Sum({&amp;lt; Year = {$(vCurrentYear)} &amp;gt;} Amount)&lt;/H4&gt;&lt;P style="margin:0px;"&gt;&lt;/P&gt;&lt;P style="margin:0px;"&gt;can you change this formual to LESS THAN?&lt;/P&gt;&lt;P style="margin:0px;"&gt;&lt;/P&gt;&lt;H4 style="margin:0px;"&gt;Sum({&amp;lt; Year = {'&amp;lt;=$(vCurrentYear)} &amp;gt;} Amount) ??&lt;/H4&gt;&lt;P style="margin:0px;"&gt;&lt;/P&gt;&lt;P style="margin:0px;"&gt;Still the problem with Less Than&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 16:28:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208594#M501580</guid>
      <dc:creator />
      <dc:date>2010-12-03T16:28:55Z</dc:date>
    </item>
    <item>
      <title>How to combine Variable and fields in an expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208595#M501581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4&gt;sum({&amp;lt;AP={'&amp;lt;=$(=$(vAP))'},F_YEAR={$(vF_YEAR)},fin_SalesGroup={'SKU'} &amp;gt;} $(vMeasure))&lt;/H4&gt;&lt;P&gt;Now i try to quote it, because i want have parts of formula in order to dynamic put together:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4&gt;='AP={'&amp;amp;chr(39)&amp;amp;'&amp;lt;=$(=$(vAP))'&amp;amp;chr(39)&amp;amp;'},F_YEAR={$(vF_YEAR)},fin_SalesGroup={'&amp;amp;chr(39)&amp;amp;'SKU'&amp;amp;chr(39)&amp;amp;'} &amp;gt;}'&lt;/H4&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;I&gt;&lt;/I&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Usage:&lt;/P&gt;&lt;H4&gt;=sum({&amp;lt; $(vYTD_SKU)&amp;gt;} ($(vMeasure)))&lt;/H4&gt;&lt;P&gt;and does not work, what a surprise&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 16:43:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208595#M501581</guid>
      <dc:creator />
      <dc:date>2010-12-03T16:43:23Z</dc:date>
    </item>
    <item>
      <title>How to combine Variable and fields in an expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208596#M501582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;These don't work either:&lt;/P&gt;&lt;H4&gt;='AP={"&amp;lt;=(=GetFieldSelections(AP))"},F_YEAR={$2},fin_SalesGroup={'&amp;amp;chr(39)&amp;amp;'SKU'&amp;amp;chr(39)&amp;amp;'}'&lt;/H4&gt;&lt;H4&gt;='AP={' &amp;amp; chr(34) &amp;amp; '&amp;lt;=(=GetFieldSelections(AP))' &amp;amp; chr(34) &amp;amp;'},F_YEAR={$2},fin_SalesGroup={'&amp;amp;chr(39)&amp;amp;'SKU'&amp;amp;chr (39)&amp;amp;'}'&lt;/H4&gt;&lt;P&gt;&lt;/P&gt;&lt;H4&gt;='AP={' &amp;amp; chr(39) &amp;amp; '&amp;lt;=(=GetFieldSelections(AP))' &amp;amp; chr(39) &amp;amp;'},F_YEAR={$2},fin_SalesGroup={'&amp;amp;chr(39)&amp;amp;'SKU'&amp;amp;chr(39)&amp;amp;'}'&lt;/H4&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;The QlikView Variable and Expression nightmare continuew, .NET and VB-Expression are 1000 times better to understand!!&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 17:52:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208596#M501582</guid>
      <dc:creator />
      <dc:date>2010-12-03T17:52:43Z</dc:date>
    </item>
    <item>
      <title>How to combine Variable and fields in an expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208597#M501583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's correct except for a little typo (the closing quote):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;SUM({&amp;lt; YEAR = {'&amp;lt;=$(VCURRENTYEAR)&lt;B&gt;'&lt;/B&gt;} &amp;gt;} AMOUNT)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I assume that YEAR and VCURRENTYEAR will have an equivalent value (2010-2010, not 2010-10, for example).&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 18:05:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208597#M501583</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-12-03T18:05:29Z</dc:date>
    </item>
    <item>
      <title>How to combine Variable and fields in an expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208598#M501584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've attached an example (not Personal Edition, if you cannot see it let me know) with variables within variables and the element funciton P() to consider all selected values within a field. I'm SETting variables in the load scipt, don't knwo if that suits you but I'll give it a try.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 18:21:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208598#M501584</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-12-03T18:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine Variable and fields in an expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208599#M501585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;I've a similar problem. I've tried everything but I'm not finding solution.&lt;/P&gt;&lt;P&gt;Could you give me some help please.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/message/268331#268331"&gt;http://community.qlik.com/message/268331#268331&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 14:21:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Variable-and-fields-in-an-expression/m-p/208599#M501585</guid>
      <dc:creator>bruno_m_santos</dc:creator>
      <dc:date>2012-10-11T14:21:43Z</dc:date>
    </item>
  </channel>
</rss>

