<?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 use below expression in the scripting in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/how-to-use-below-expression-in-the-scripting/m-p/967358#M956574</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Could you please help me,I have an straight table expression like this,&lt;BR /&gt;if(Metrics='Approval rate' or Metrics='Activation Rate',num(Only({&amp;lt;Year={'=max(Year)'},Scenario={'Actual'},&lt;BR /&gt; Year={$(=max(Year))},MonthNum={$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;}MonthNum))}&amp;gt;}Value),'#,##0%'),&lt;BR /&gt; Only({&amp;lt;Year={'=max(Year)'},Scenario={'Actual'},Year={$(=max(Year))},MonthNum={$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;}MonthNum))}&amp;gt;}Value)); if(Metrics='Approval rate' or Metrics='Activation Rate',num(Only({&amp;lt;Year={'=max(Year)'},Scenario={'Actual'},&lt;BR /&gt; Year={$(=max(Year))},MonthNum={$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;}MonthNum))}&amp;gt;}Value),'#,##0%'),&lt;BR /&gt; Only({&amp;lt;Year={'=max(Year)'},Scenario={'Actual'},Year={$(=max(Year))},MonthNum={$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;}MonthNum))}&amp;gt;}Value)); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;and I need put this expression in the scripting , can any one show me how to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Nov 2015 07:23:06 GMT</pubDate>
    <dc:creator>divianjani</dc:creator>
    <dc:date>2015-11-10T07:23:06Z</dc:date>
    <item>
      <title>how to use below expression in the scripting</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-use-below-expression-in-the-scripting/m-p/967358#M956574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Could you please help me,I have an straight table expression like this,&lt;BR /&gt;if(Metrics='Approval rate' or Metrics='Activation Rate',num(Only({&amp;lt;Year={'=max(Year)'},Scenario={'Actual'},&lt;BR /&gt; Year={$(=max(Year))},MonthNum={$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;}MonthNum))}&amp;gt;}Value),'#,##0%'),&lt;BR /&gt; Only({&amp;lt;Year={'=max(Year)'},Scenario={'Actual'},Year={$(=max(Year))},MonthNum={$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;}MonthNum))}&amp;gt;}Value)); if(Metrics='Approval rate' or Metrics='Activation Rate',num(Only({&amp;lt;Year={'=max(Year)'},Scenario={'Actual'},&lt;BR /&gt; Year={$(=max(Year))},MonthNum={$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;}MonthNum))}&amp;gt;}Value),'#,##0%'),&lt;BR /&gt; Only({&amp;lt;Year={'=max(Year)'},Scenario={'Actual'},Year={$(=max(Year))},MonthNum={$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;}MonthNum))}&amp;gt;}Value)); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;and I need put this expression in the scripting , can any one show me how to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 07:23:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-use-below-expression-in-the-scripting/m-p/967358#M956574</guid>
      <dc:creator>divianjani</dc:creator>
      <dc:date>2015-11-10T07:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to use below expression in the scripting</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-use-below-expression-in-the-scripting/m-p/967359#M956575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't use set analysis in the script. So your expression can't be put in the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 10:49:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-use-below-expression-in-the-scripting/m-p/967359#M956575</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-11-10T10:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to use below expression in the scripting</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-use-below-expression-in-the-scripting/m-p/967360#M956576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you will need to create a consolidation-table with an aggregation load, something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;consolidation:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;Metrics, Scenario, Year, MonthNum, sum(Value) as Value&lt;/P&gt;&lt;P&gt;Resident xyz&lt;/P&gt;&lt;P&gt;Group By Metrics, Scenario, Year, MonthNum;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If these fields didn't belong to one table you need to match them before maybe per mapping or joining. To consider is further if a filtering of those data to the max. Year is needed then often it's best to join pre-calculations from script with gui-calculations instead of doing it solely there or there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 10:55:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-use-below-expression-in-the-scripting/m-p/967360#M956576</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-11-10T10:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to use below expression in the scripting</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-use-below-expression-in-the-scripting/m-p/967361#M956577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anjali R,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't just transpose an expression like that, especially a dynamic one, straight into the script.&lt;/P&gt;&lt;P&gt;The scripts in themselves look acceptable.&amp;nbsp; If your application is running slowly, or maintenance is becoming an overhead, then it is worthwhile optimising and looking for performance improvements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A couple of things you could consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Calendar flags, to make selecting current year, max year etc quicker (see Jason Pierce's excellent post here:&lt;A href="https://community.qlik.com/docs/DOC-13536"&gt;Calendar with AsOf Flags, Compare Easter to Easter&lt;/A&gt;)&lt;/LI&gt;&lt;LI&gt;Remove IF statements.&amp;nbsp; IFs are memory intensive because QlikView evaluates all expressions in the IF before processing the condition.&amp;nbsp; You can often use the PICK() or MATCH functions to do the same thing as IF without the extra ovverhead, eg PICK(MATCH([field],'Approval Rate', Activation Rate),vExpression1,vExpression2)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hope that gives you some ideas.&lt;/P&gt;&lt;P&gt;George&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 11:02:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-use-below-expression-in-the-scripting/m-p/967361#M956577</guid>
      <dc:creator>gsbeaton</dc:creator>
      <dc:date>2015-11-10T11:02:58Z</dc:date>
    </item>
  </channel>
</rss>

