<?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: FirstSortedValue in script returns different results than expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-in-script-returns-different-results-than/m-p/20214#M606889</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Division, Type, Name&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Mar 2018 17:29:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-03-13T17:29:16Z</dc:date>
    <item>
      <title>FirstSortedValue in script returns different results than expression</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-in-script-returns-different-results-than/m-p/20212#M606887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;,if([Covenant Days Past Due] &amp;gt; 0, 'Past Due', if([Covenant Days Past Due] &amp;lt; -180, 'Future &amp;gt;180 Days Away', if([Covenant Days Past Due] &amp;gt;= -180 and [Covenant Days Past Due] &amp;lt;= 0, 'Pending Next 6 Months',&lt;/P&gt;&lt;P&gt;&amp;nbsp; firstsortedvalue([Covenant Compliance Status],-[Covenant Compliance Last Modified Date])))) as [Covenant Compliance Complete Status] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the above calculation in an expression and it works great. I now want to use it as a "bucket" so I tried to move it to a dimension. I read you cannot use first sorted value in a dimension so I tried to move the below section to the script to store and then be able to use in dimension. This gave me way different results in the chart then it does when I use the whole thing as an expression. &lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 13.3333px;"&gt;firstsortedvalue([Covenant Compliance Status],-[Covenant Compliance Last Modified Date]) &lt;SPAN style="font-size: 13.3333px;"&gt;as [Covenant Compliance Complete Status]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;New code in chart that displays incorrect results: &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;,if([Covenant Days Past Due] &amp;gt; 0, 'Past Due', if([Covenant Days Past Due] &amp;lt; -180, 'Future &amp;gt;180 Days Away', if([Covenant Days Past Due] &amp;gt;= -180 and [Covenant Days Past Due] &amp;lt;= 0, 'Pending Next 6 Months', &lt;SPAN style="font-size: 13.3333px;"&gt;[Covenant Compliance Complete Status])))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea why this doesnt work? I really need this as a dimension. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 17:25:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-in-script-returns-different-results-than/m-p/20212#M606887</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-13T17:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue in script returns different results than expression</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-in-script-returns-different-results-than/m-p/20213#M606888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you used the above as an expression... what was your dimensions in the chart?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 17:27:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-in-script-returns-different-results-than/m-p/20213#M606888</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-03-13T17:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue in script returns different results than expression</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-in-script-returns-different-results-than/m-p/20214#M606889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Division, Type, Name&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 17:29:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-in-script-returns-different-results-than/m-p/20214#M606889</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-13T17:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue in script returns different results than expression</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-in-script-returns-different-results-than/m-p/20215#M606890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) You can use this in your dimension like this.... (if you don't want to create this in the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;if([Covenant Days Past Due] &amp;gt; 0, 'Past Due',&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;if([Covenant Days Past Due] &amp;lt; -180, 'Future &amp;gt;180 Days Away',&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;if([Covenant Days Past Due] &amp;gt;= -180 and [Covenant Days Past Due] &amp;lt;= 0, 'Pending Next 6 Months',&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; firstsortedvalue([Covenant Compliance Status],-[Covenant Compliance Last Modified Date]))),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Division, Type, Name)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;2) When you used this in the script... did you use Group By Division, Type, Name or were there more dimensions in your chart?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 17:31:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-in-script-returns-different-results-than/m-p/20215#M606890</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-03-13T17:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue in script returns different results than expression</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-in-script-returns-different-results-than/m-p/20216#M606891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked as a dimension! Thank you so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 17:40:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-in-script-returns-different-results-than/m-p/20216#M606891</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-13T17:40:56Z</dc:date>
    </item>
  </channel>
</rss>

