<?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 Function in variable / dollar sign expansion in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Function-in-variable-dollar-sign-expansion/m-p/887858#M995840</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable called Bottom_score which calculates the sum of bottom N scores of a question,&amp;nbsp; The variable is defined like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bottom_score:&lt;/P&gt;&lt;P&gt;sum( {&amp;lt;ID={"=aggr(rank(-sum($2),4,1), Survey_Name) &amp;lt;= $1"}&amp;gt;}&amp;nbsp; $2)&lt;/P&gt;&lt;P&gt;where $1 is the N and $2 is the score of a particular question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the chart, I then put an expression:&lt;/P&gt;&lt;P&gt;$(Bottom_score(3,Q818))&lt;/P&gt;&lt;P&gt;So this returns me the sum of bottom 3 scores of question Q818. So far it works perfectly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But afterwards I realised that some of the raw scores of questions contain "N/A". Ideally these results should be ignored in calculation but the above function always include those "N/A" as some of the bottom results. For some reason I can't remove / get rid of those responses in raw data, nor can I do that in loading script. Thus I would like to do this in the chart expression by trying some like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(Bottom_score(&amp;nbsp; 3+count( {$&amp;lt;Q818={'NA'}&amp;gt;} Q818)&amp;nbsp; , Q818))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I found that 'count( {$&amp;lt;Q818={'NA'}&amp;gt;} Q818)' simply doesn't work. Is there any problem in the syntax? Or does it related to my use of dollar sign expansion in the expression?&lt;/P&gt;&lt;P&gt;Thanks. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Jun 2015 07:04:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-06-24T07:04:10Z</dc:date>
    <item>
      <title>Function in variable / dollar sign expansion</title>
      <link>https://community.qlik.com/t5/QlikView/Function-in-variable-dollar-sign-expansion/m-p/887858#M995840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable called Bottom_score which calculates the sum of bottom N scores of a question,&amp;nbsp; The variable is defined like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bottom_score:&lt;/P&gt;&lt;P&gt;sum( {&amp;lt;ID={"=aggr(rank(-sum($2),4,1), Survey_Name) &amp;lt;= $1"}&amp;gt;}&amp;nbsp; $2)&lt;/P&gt;&lt;P&gt;where $1 is the N and $2 is the score of a particular question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the chart, I then put an expression:&lt;/P&gt;&lt;P&gt;$(Bottom_score(3,Q818))&lt;/P&gt;&lt;P&gt;So this returns me the sum of bottom 3 scores of question Q818. So far it works perfectly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But afterwards I realised that some of the raw scores of questions contain "N/A". Ideally these results should be ignored in calculation but the above function always include those "N/A" as some of the bottom results. For some reason I can't remove / get rid of those responses in raw data, nor can I do that in loading script. Thus I would like to do this in the chart expression by trying some like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(Bottom_score(&amp;nbsp; 3+count( {$&amp;lt;Q818={'NA'}&amp;gt;} Q818)&amp;nbsp; , Q818))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I found that 'count( {$&amp;lt;Q818={'NA'}&amp;gt;} Q818)' simply doesn't work. Is there any problem in the syntax? Or does it related to my use of dollar sign expansion in the expression?&lt;/P&gt;&lt;P&gt;Thanks. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2015 07:04:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Function-in-variable-dollar-sign-expansion/m-p/887858#M995840</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-24T07:04:10Z</dc:date>
    </item>
  </channel>
</rss>

