<?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: Passing a variable to an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457804#M486640</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your first expression works, I then add the variable like you show, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the last expression still doesn't work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Feb 2013 10:23:36 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-02-21T10:23:36Z</dc:date>
    <item>
      <title>Passing a variable to an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457799#M486635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having a problem returning a value for my expression below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;TrnMonth={$('vTrnMonthSelected')}&amp;gt;}NetSalesValue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where TrnMonth is the selection the user makes via a List Box&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and vTrnMonthSelected is a variable with the below formula&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GetFieldSelections(TrnMonth)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and NetSalesValue is the summed value I want returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All I get back is 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use just $(vTrnMonthSelected) it returns the selections but whenever I run the main sum line, I cannot seem to get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be brilliant &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 09:53:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457799#M486635</guid>
      <dc:creator />
      <dc:date>2013-02-21T09:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a variable to an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457800#M486636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use &lt;/P&gt;&lt;P&gt;={$(vTrnMonthSelected)}&amp;gt;} without ' char ... or ={'$(vTrnMonthSelected)'}&amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 09:56:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457800#M486636</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2013-02-21T09:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a variable to an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457801#M486637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately still not working with :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;TrnMonth={'$(vTrnMonthSelected)'}&amp;gt;}NetSalesValue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yeah I know I could just use the sum(NetSalesValues), I wanted to use the formula though to add some logic and this was the first step in getting the completed formula complete, but alas it still doesn't work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 10:01:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457801#M486637</guid>
      <dc:creator />
      <dc:date>2013-02-21T10:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a variable to an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457802#M486638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope, neither works unfortunately&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 10:02:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457802#M486638</guid>
      <dc:creator />
      <dc:date>2013-02-21T10:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a variable to an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457803#M486639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this without using variable,&lt;/P&gt;&lt;P&gt;sum({&amp;lt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;TrnMonth&lt;/SPAN&gt;={"$(=&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;TrnMonth&lt;/SPAN&gt;)"}&amp;gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;NetSalesValue&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;and for variable create like this:-&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;vTrnMonthSelected&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(SubField(GetCurrentSelections(),':',-1))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;hii sry for late response, try this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;THEN,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum(if(&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;TrnMonth&lt;/SPAN&gt;=&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;vTrnMonthSelected&lt;/SPAN&gt;,&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;NetSalesValue&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;HOPE it helps&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 10:05:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457803#M486639</guid>
      <dc:creator>er_mohit</dc:creator>
      <dc:date>2013-02-21T10:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a variable to an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457804#M486640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your first expression works, I then add the variable like you show, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the last expression still doesn't work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 10:23:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457804#M486640</guid>
      <dc:creator />
      <dc:date>2013-02-21T10:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a variable to an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457805#M486641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change your variable from "GetFieldSelections(TrnMonth)" to "=GetFieldSelections(TrnMonth)"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 12:21:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-variable-to-an-expression/m-p/457805#M486641</guid>
      <dc:creator>danielrozental</dc:creator>
      <dc:date>2013-02-21T12:21:25Z</dc:date>
    </item>
  </channel>
</rss>

