<?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 Variable not evaluating correctly in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-not-evaluating-correctly/m-p/195985#M56248</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 have a variable in the application which is not evaluating correctly. The code for this variable is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;=&lt;BR /&gt;'FIELDVALUE('&lt;B&gt;CurrentQtrYear1'&lt;/B&gt;,&lt;B&gt;FieldIndex&lt;/B&gt;('CurrentQtrYear',&lt;B&gt;GetFieldSelections&lt;/B&gt;(&lt;B&gt;CurrentQtrYear&lt;/B&gt;)))'&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The fields 'CurrentQtrYear' and 'CurrentQtrYear1' belong to same table. I am trying to get the value of 'CurrentQtrYear1' for value selected for 'CurrentQtrYear'. When I put the above code in a text box, it evaluates properly but when I try to do this through a variable, it does not work.&lt;/P&gt;&lt;P&gt;Any suggestyions?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Dec 2009 19:15:20 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-12-23T19:15:20Z</dc:date>
    <item>
      <title>Variable not evaluating correctly</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-not-evaluating-correctly/m-p/195985#M56248</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 have a variable in the application which is not evaluating correctly. The code for this variable is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;=&lt;BR /&gt;'FIELDVALUE('&lt;B&gt;CurrentQtrYear1'&lt;/B&gt;,&lt;B&gt;FieldIndex&lt;/B&gt;('CurrentQtrYear',&lt;B&gt;GetFieldSelections&lt;/B&gt;(&lt;B&gt;CurrentQtrYear&lt;/B&gt;)))'&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The fields 'CurrentQtrYear' and 'CurrentQtrYear1' belong to same table. I am trying to get the value of 'CurrentQtrYear1' for value selected for 'CurrentQtrYear'. When I put the above code in a text box, it evaluates properly but when I try to do this through a variable, it does not work.&lt;/P&gt;&lt;P&gt;Any suggestyions?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2009 19:15:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-not-evaluating-correctly/m-p/195985#M56248</guid>
      <dc:creator />
      <dc:date>2009-12-23T19:15:20Z</dc:date>
    </item>
    <item>
      <title>Variable not evaluating correctly</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-not-evaluating-correctly/m-p/195986#M56249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure what the problem is here, but I would try removing the single quotes around the entire function. Using a QlikView file that I have (different field names), I was able to get this to resolve in a text box:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=FIELDVALUE('Customer',FieldIndex('FK',GetFieldSelections(FK)))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Then, I created a variable (vVal) and set it to:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=FIELDVALUE('Customer',FieldIndex('FK',GetFieldSelections(FK)))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Then in a text box, the following expression gets the same result as the one above:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=vVar&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Using single quotes around the entire expression didn't work. This resolved to null:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;='FIELDVALUE('Customer',FieldIndex('FK',GetFieldSelections(FK)))'&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;What happens when you try to use a variable? Is it always null? Are you using multiple selections? This only seems to work on single selections both using a variable and without.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2009 23:42:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-not-evaluating-correctly/m-p/195986#M56249</guid>
      <dc:creator />
      <dc:date>2009-12-23T23:42:02Z</dc:date>
    </item>
    <item>
      <title>Variable not evaluating correctly</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-not-evaluating-correctly/m-p/195987#M56250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, this works.&lt;/P&gt;&lt;P&gt;I was trying to use the variable in set analysis and in text box and used $(vVar) at both the places. Finally it worked with $(vVar) in set analysis and vVar in text box.&lt;/P&gt;&lt;P&gt;Thanks once again.&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Dec 2009 12:39:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-not-evaluating-correctly/m-p/195987#M56250</guid>
      <dc:creator />
      <dc:date>2009-12-24T12:39:18Z</dc:date>
    </item>
  </channel>
</rss>

