<?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: Optimize an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29906#M771761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not inside set analysis. &lt;A href="https://community.qlik.com/people/avkeep01"&gt;avkeep01&lt;/A&gt; is right because set analysis is evaluated once per chart.... you might add TOTAL &amp;lt;Customer&amp;gt;, but &amp;lt;Customer&amp;gt; is going to be ignored because it cannot use multiple max dates based on different customers.... it will use only one max date across all customers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 May 2018 12:12:46 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-05-30T12:12:46Z</dc:date>
    <item>
      <title>Optimize an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29902#M771757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to help on a thread and I found the right expression for the expected output, however, I did not find a way to optimize the expression using it's equivalent in set analysis or using the If statement inside the expression..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to get the Status of the Max Date By Customer and keep Customer, Date and Status as dimensions on the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the tablebox (left) and the final table &lt;SPAN style="font-size: 13.3333px;"&gt;(right)&lt;/SPAN&gt; with Exp1 (the working expression) and Exp2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="203900" alt="Status max Date by customer.png" class="jive-image image-1" src="/legacyfs/online/203900_Status max Date by customer.png" style="height: 174px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exp1: &lt;STRONG&gt;=if(Date=Max(TOTAL &amp;lt;Customer&amp;gt;&amp;nbsp; Date),only(Status)) &lt;/STRONG&gt;==&amp;gt; this is working&lt;/P&gt;&lt;P&gt;Exp2: &lt;STRONG&gt;=Only({&amp;lt;Date={'$(=Max(TOTAL &amp;lt;Customer&amp;gt;&amp;nbsp; Date))'}&amp;gt;}Status) &lt;/STRONG&gt;==&amp;gt; not working on the third line..&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I was also trying:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Exp3: =only(if(Date=Max(TOTAL &amp;lt;Customer&amp;gt;&amp;nbsp; Date),Status)) &lt;/STRONG&gt;==&amp;gt; not working&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I just want to know why I can't replace Exp1 using a set analysis or using the If inside the Expression..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I'm doing wrong ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA the App&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29902#M771757</guid>
      <dc:creator>YoussefBelloum</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29903#M771758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the set analysis the calculation is done outside of the object. &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;$(=Max(TOTAL &amp;lt;Customer&amp;gt;&amp;nbsp; Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Basically like using a variable. It doesn't take the dimensions of the object in consideration. The first expression does that. So your results could be different. You should try &lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;$(=Max(TOTAL &amp;lt;Customer&amp;gt;&amp;nbsp; Date) &lt;/STRONG&gt;outside the object to see which date is shown. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 12:00:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29903#M771758</guid>
      <dc:creator>avkeep01</dc:creator>
      <dc:date>2018-05-30T12:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29904#M771759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Only(Aggr(If(Date = Max(TOTAL &amp;lt;Customer&amp;gt;&amp;nbsp; Date), Status), Customer, Date))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;but why not use FirstSortedValue here?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Didn't realize Date was one of the dimensions... may be change that to an expression... Max(Date) and then try this FirstSortedValue(Status, -Date)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 12:02:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29904#M771759</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-30T12:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29905#M771760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think so, I'm using Total &amp;lt;Customer&amp;gt; so it is Grouping by the Dimension inside the table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 12:09:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29905#M771760</guid>
      <dc:creator>YoussefBelloum</dc:creator>
      <dc:date>2018-05-30T12:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29906#M771761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not inside set analysis. &lt;A href="https://community.qlik.com/people/avkeep01"&gt;avkeep01&lt;/A&gt; is right because set analysis is evaluated once per chart.... you might add TOTAL &amp;lt;Customer&amp;gt;, but &amp;lt;Customer&amp;gt; is going to be ignored because it cannot use multiple max dates based on different customers.... it will use only one max date across all customers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 12:12:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29906#M771761</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-30T12:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29907#M771762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't use FirstSortedValue because I was tryng to use all the dimensions on the table (including Status)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 12:15:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29907#M771762</guid>
      <dc:creator>YoussefBelloum</dc:creator>
      <dc:date>2018-05-30T12:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29908#M771763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can still use Date as a dimension, if you are okay with calculated dimension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(Max(Date), Customer)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 12:17:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29908#M771763</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-30T12:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29909#M771764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry &lt;A href="https://community.qlik.com/qlik-users/42534"&gt;avkeep01&lt;/A&gt; Didn't read carefully what you wrote, I forgot that I was using it inside a set analysis..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 12:19:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29909#M771764</guid>
      <dc:creator>YoussefBelloum</dc:creator>
      <dc:date>2018-05-30T12:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29910#M771765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem. We are all here to help you. I think Sunny has the right solution for you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 12:22:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29910#M771765</guid>
      <dc:creator>avkeep01</dc:creator>
      <dc:date>2018-05-30T12:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29911#M771766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much to all of you , I really appreciate !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 12:24:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-an-expression/m-p/29911#M771766</guid>
      <dc:creator>YoussefBelloum</dc:creator>
      <dc:date>2018-05-30T12:24:21Z</dc:date>
    </item>
  </channel>
</rss>

