<?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: Expression is not getting the right nrs in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393493#M146723</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you put =$(varPlReportingYear) into a text box, it will work. However if you try it in set analysis, it will not work. Variables can not pass value to fields like that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attatch a small sample file to explain to you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work for your case:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (Index([Expense Type (annual)], 'Base Rent') &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Index([Lease Type], 'Lease') &amp;gt; 0,&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[Year of Expense] = {"=$(varPlReportingYear)"}&amp;gt;}[Amount of Expense (USD-annual)])&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Sep 2012 04:24:24 GMT</pubDate>
    <dc:creator>NZFei</dc:creator>
    <dc:date>2012-09-11T04:24:24Z</dc:date>
    <item>
      <title>Expression is not getting the right nrs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393488#M146718</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;Not sure what's wrong with this expression :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((([Year of Expense] = $(varPlReportingYear))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and (Index([Expense Type (annual)], 'Base Rent') &amp;gt; 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and (Index([Lease Type], 'Lease') &amp;gt; 0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , [Amount of Expense (USD-annual)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is getting me a wrong nr like I am getting 169 millions instead of 77 millions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I put the fields in a table and apply three filters for Year of expense and expense type(annual) and Lease type&amp;nbsp; I get the right nrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to do Sum([Amount of Expense (USD-annual)])&amp;nbsp; and apply the filters separately and it worked fine but when I use it in expression it doesn't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thxs,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 20:37:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393488#M146718</guid>
      <dc:creator>alec1982</dc:creator>
      <dc:date>2012-09-10T20:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Expression is not getting the right nrs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393489#M146719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ([Year of Expense] = $(varPlReportingYear)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Index([Expense Type (annual)], 'Base Rent') &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Index([Lease Type], 'Lease') &amp;gt; 0,&lt;/P&gt;&lt;P&gt;sum([Amount of Expense (USD-annual)])&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 02:53:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393489#M146719</guid>
      <dc:creator>NZFei</dc:creator>
      <dc:date>2012-09-11T02:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expression is not getting the right nrs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393490#M146720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your reply,&lt;/P&gt;&lt;P&gt;I tried it but it gave me null value(-)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thxs,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 03:31:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393490#M146720</guid>
      <dc:creator>alec1982</dc:creator>
      <dc:date>2012-09-11T03:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Expression is not getting the right nrs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393491#M146721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure [Year of Expense] = $(varPlReportingYear) works well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My last suggestion is to try it without $().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; [Year of Expense] = varPlReportingYear&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 03:43:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393491#M146721</guid>
      <dc:creator>NZFei</dc:creator>
      <dc:date>2012-09-11T03:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Expression is not getting the right nrs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393492#M146722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;I have added $(varPlReportingYear) into a text box and returned the right value. and Year of Expense is the right field name.&lt;/P&gt;&lt;P&gt;[Year of Expense] = varPlReportingYear doesn't help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thxs,&lt;/P&gt;&lt;P&gt;Alec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 03:51:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393492#M146722</guid>
      <dc:creator>alec1982</dc:creator>
      <dc:date>2012-09-11T03:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Expression is not getting the right nrs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393493#M146723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you put =$(varPlReportingYear) into a text box, it will work. However if you try it in set analysis, it will not work. Variables can not pass value to fields like that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attatch a small sample file to explain to you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work for your case:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (Index([Expense Type (annual)], 'Base Rent') &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Index([Lease Type], 'Lease') &amp;gt; 0,&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[Year of Expense] = {"=$(varPlReportingYear)"}&amp;gt;}[Amount of Expense (USD-annual)])&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 04:24:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393493#M146723</guid>
      <dc:creator>NZFei</dc:creator>
      <dc:date>2012-09-11T04:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Expression is not getting the right nrs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393494#M146724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you so much for your reply,&lt;/P&gt;&lt;P&gt;I guess that in the sample above the same problem is occuring.&lt;/P&gt;&lt;P&gt;I have added a chart that looks exactly the same called Current year cost.&lt;/P&gt;&lt;P&gt;Let me know your thoughts.&lt;/P&gt;&lt;P&gt;Thxs,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 05:00:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-is-not-getting-the-right-nrs/m-p/393494#M146724</guid>
      <dc:creator>alec1982</dc:creator>
      <dc:date>2012-09-11T05:00:15Z</dc:date>
    </item>
  </channel>
</rss>

