<?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: Calling max value in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calling-max-value-in-set-analysis/m-p/797933#M472359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi M,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what does your model look like, you are using FiscalYear2 in your set analysis, but from the code this looks like it might be a data island and not connected to your Volume field?&lt;/P&gt;&lt;P&gt;Also you are using the date field which is in the format 'FYxx' but trying to select '3' within it, so the set won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you want to do I believe is to create a variable which based on your max rowno() returns the corresponding FiscalYear2 value, you can then use that variable in your sum expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see attached, hope that helps&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Jan 2015 14:50:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-01-15T14:50:35Z</dc:date>
    <item>
      <title>Calling max value in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-max-value-in-set-analysis/m-p/797931#M472357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have loaded in a table with Fiscal Year and RowNo() in order to be able to call the Fiscal Year value in set analysis through the max RowNo. I have done this because I was unable to call the maximum Fiscal Year (format - 'FY14').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My formula should sum Volume for the most recent FY in the model (i.e. max row number). My set analysis is currently not working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;[FiscalYear2]={$(=max(RowNo()))}&amp;gt;}[Volume])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, I would like to do the same for RowNo - 1, to return the 2nd most recent FY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script to create the table is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[FY Count]:&lt;/P&gt;&lt;P&gt;LOAD distinct&lt;/P&gt;&lt;P&gt;FiscalYear2,&lt;/P&gt;&lt;P&gt;RowNo()&lt;/P&gt;&lt;P&gt;resident [FYCount]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75381_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please can you advise?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 13:47:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-max-value-in-set-analysis/m-p/797931#M472357</guid>
      <dc:creator />
      <dc:date>2015-01-15T13:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calling max value in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-max-value-in-set-analysis/m-p/797932#M472358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for max FY use formula&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=FirstSortedValue(FiscalYear2,-[RowNo()])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the original data seems to be different than the reflected one. Bz FY is a value derived from Dates not like this one. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 14:47:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-max-value-in-set-analysis/m-p/797932#M472358</guid>
      <dc:creator>ashwanin</dc:creator>
      <dc:date>2015-01-15T14:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calling max value in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-max-value-in-set-analysis/m-p/797933#M472359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi M,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what does your model look like, you are using FiscalYear2 in your set analysis, but from the code this looks like it might be a data island and not connected to your Volume field?&lt;/P&gt;&lt;P&gt;Also you are using the date field which is in the format 'FYxx' but trying to select '3' within it, so the set won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you want to do I believe is to create a variable which based on your max rowno() returns the corresponding FiscalYear2 value, you can then use that variable in your sum expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see attached, hope that helps&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 14:50:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-max-value-in-set-analysis/m-p/797933#M472359</guid>
      <dc:creator />
      <dc:date>2015-01-15T14:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calling max value in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-max-value-in-set-analysis/m-p/797934#M472360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe, yes that's exactly it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've amended my set analysis to call when RowNo() (which I've renamed to FYRow), which works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=sum({$&amp;lt;FiscalYear2 = , [FYRow]={'2'}&amp;gt;}[Volume])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=sum({$&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;FiscalYear2 = , &lt;/SPAN&gt;[FYRow]={'1'}&amp;gt;}[Volume])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thanks for the help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;M&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 14:54:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-max-value-in-set-analysis/m-p/797934#M472360</guid>
      <dc:creator />
      <dc:date>2015-01-15T14:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calling max value in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-max-value-in-set-analysis/m-p/797935#M472361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;glad to help, sorry I thought you had those disconnected which is what I went with in my example.&lt;/P&gt;&lt;P&gt; One thing I would say is, you might want to avoid hardcoding the expressions like that, as it means next year you will need to adjust for the latest year, better to use a variable so it dynamically changes as time goes on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope that helps&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 15:18:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-max-value-in-set-analysis/m-p/797935#M472361</guid>
      <dc:creator />
      <dc:date>2015-01-15T15:18:26Z</dc:date>
    </item>
  </channel>
</rss>

