<?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: Using Functions in Expressions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Functions-in-Expressions/m-p/482369#M480802</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If "year" field is numeric you can do something like (without cuotes):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM({$&amp;lt;year={$(=year(MAX(end_date)))}&amp;gt;}percent)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you put the expresion "=year(MAX(end_date))" in a variable you can simplify your expresion in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In script:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET vMaxYear = '=year(MAX(end_date))';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expresion:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM({$&amp;lt;year={$(vMaxYear)}&amp;gt;}percent)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variable vMaxYear is dynamic relatively of the selections, but is not afected by the dimension of the graphic when you put in a expresion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the dimension of your graphic? You should keep in mind that if Percent is a field precalculated in Load Script time as a Monthly percent when is aggregated by Months in a Qlikview graphic and totalize, monthly value shows fine but the total not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Nov 2013 16:28:07 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-11-05T16:28:07Z</dc:date>
    <item>
      <title>Using Functions in Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Functions-in-Expressions/m-p/482367#M480800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an expression that I am trying to use a function in. I have percents that need to be summed&lt;/P&gt;&lt;P&gt;=SUM(Percent) works fine. The percentage is a preset amount. (e.g.&amp;nbsp; abc gets 10%,&amp;nbsp; cde gets 90% and both abc and cde fall under xyz which would be at 100%).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This information is repeated on a monthly basis. Over the course of a year xyz winds up with 1200% which is incorrect. xyz should have 100%. If I can get MAX(end_date) into my expression then I will have the number that I need.I am having no luck finding proper syntaxing.&lt;/P&gt;&lt;P&gt;I have =SUM({$&amp;lt;year={"$(=year(MAX(end_date)))"}&amp;gt;}percent)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I approaching this incorrectly or is there syntax that I am missing? I have no problem using variables in the expression, but they are not dynamic. I need to use the end_date field value with the YEAR and MAX functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone got any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 16:00:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Functions-in-Expressions/m-p/482367#M480800</guid>
      <dc:creator />
      <dc:date>2013-11-05T16:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using Functions in Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Functions-in-Expressions/m-p/482368#M480801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=year(MAX(end_date))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in a text box, what do you get? 2013? And if you use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({$&amp;lt;year={2013}&amp;gt;} percent)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do you get the correct sum?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 16:21:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Functions-in-Expressions/m-p/482368#M480801</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-11-05T16:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using Functions in Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Functions-in-Expressions/m-p/482369#M480802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If "year" field is numeric you can do something like (without cuotes):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM({$&amp;lt;year={$(=year(MAX(end_date)))}&amp;gt;}percent)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you put the expresion "=year(MAX(end_date))" in a variable you can simplify your expresion in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In script:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET vMaxYear = '=year(MAX(end_date))';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expresion:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM({$&amp;lt;year={$(vMaxYear)}&amp;gt;}percent)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variable vMaxYear is dynamic relatively of the selections, but is not afected by the dimension of the graphic when you put in a expresion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the dimension of your graphic? You should keep in mind that if Percent is a field precalculated in Load Script time as a Monthly percent when is aggregated by Months in a Qlikview graphic and totalize, monthly value shows fine but the total not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 16:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Functions-in-Expressions/m-p/482369#M480802</guid>
      <dc:creator />
      <dc:date>2013-11-05T16:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using Functions in Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Functions-in-Expressions/m-p/482370#M480803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried the text box and it works. I have also tried the expression you wrote and it works. I have percentages from previous years that are not showing up, so I need that dynamic year.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 16:42:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Functions-in-Expressions/m-p/482370#M480803</guid>
      <dc:creator />
      <dc:date>2013-11-05T16:42:01Z</dc:date>
    </item>
  </channel>
</rss>

