<?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 Set Analysis Expression in Wrong Way in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-in-Wrong-Way/m-p/314722#M116134</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Juan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the GetCurrentField() function is described in the Help as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor1295"&gt;&lt;/A&gt;&lt;A name="GetCurrentField("&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;GetCurrentField(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;groupname&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;returns the name of the field currently active in the group named &lt;SPAN class="Italic"&gt;groupname&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you need to state a groupname, not a field name, and it's only really useful when used in a chart object with a group used. I assume you want to use GetFieldSelections( Mes) or GetSelectedCount( Mes ) instead (latter will return 0 if no selections are made in field Mes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then&amp;nbsp; I would recheck the if-then-else paths, I am not sure if all parentheses are set correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if this will explain what you see. If not, could you upload a small sample?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Feb 2012 23:30:47 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-02-23T23:30:47Z</dc:date>
    <item>
      <title>Set Analysis Expression in Wrong Way</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-in-Wrong-Way/m-p/314721#M116133</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 this set analysis expression. It's supposed to return today's month and year if I have no selection at all (that's workin fine), if I select any date from 2011, is working fine also. But my table has data until february of 2012, when I select january/2012, the expression assumes that I have no month selected and return me today's month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If((IsNull(GetCurrentField(Mes))),(if(Max(Año)=Year(Today()),Month(Date(Today(),'MMM')),Date(Date#(Max(Mes),'MM'),'MMM'))),Date(Date#(Max(Mes),'MM'),'MMM'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if I made my point clear, I'm kind of desperate because I don't know what else to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 21:03:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-in-Wrong-Way/m-p/314721#M116133</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-23T21:03:40Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Expression in Wrong Way</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-in-Wrong-Way/m-p/314722#M116134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Juan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the GetCurrentField() function is described in the Help as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor1295"&gt;&lt;/A&gt;&lt;A name="GetCurrentField("&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;GetCurrentField(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;groupname&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;returns the name of the field currently active in the group named &lt;SPAN class="Italic"&gt;groupname&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you need to state a groupname, not a field name, and it's only really useful when used in a chart object with a group used. I assume you want to use GetFieldSelections( Mes) or GetSelectedCount( Mes ) instead (latter will return 0 if no selections are made in field Mes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then&amp;nbsp; I would recheck the if-then-else paths, I am not sure if all parentheses are set correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if this will explain what you see. If not, could you upload a small sample?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 23:30:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-in-Wrong-Way/m-p/314722#M116134</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-02-23T23:30:47Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Expression in Wrong Way</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-in-Wrong-Way/m-p/314723#M116135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Juan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would think you need to set a variable to your maximum date&amp;nbsp; ie: vMaxDate = MAX((YourDateValue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then test your date against this variable using Set Analysis in your objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM( {$&amp;lt; YourDateValue = {'$(vMaxDate)'} &amp;gt;} YourValue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will always display the most current date range of data even if you change your filters.&amp;nbsp; You can adjust the above if you want to limit to Month/Year or what ever.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 02:58:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-in-Wrong-Way/m-p/314723#M116135</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-24T02:58:54Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Expression in Wrong Way</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-in-Wrong-Way/m-p/314724#M116136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the expression in my gauge chart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=(Count({$&amp;lt; Año={$(=Max(Año))}, Mes={$(=Date(Date#(Max(Mes),'MM'),'MMM'))} &amp;gt;}[Identificación afiliado]) - Count({$&amp;lt;Año={$(=If(Date(Date#(Max(Mes),'MM'),'MMM')='ene',Max(Año-1),Max(Año)))}, Mes={$(=If(Date(Date#(Max(Mes),'MM'),'MMM')='ene','dic',Date(Date#(Max(Mes-1),'MM'),'MMM')))} &amp;gt;}[Identificación afiliado])) / Count({$&amp;lt;Año={$(=If(Date(Date#(Max(Mes),'MM'),'MMM')='ene',Max(Año-1),Max(Año)))}, Mes={$(=If(Date(Date#(Max(Mes),'MM'),'MMM')='ene','dic',Date(Date#(Max(Mes-1),'MM'),'MMM')))} &amp;gt;}[Identificación afiliado])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now, I've created this variable in order to validate the selections&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If(IsNull(GetCurrentField(Mes)),if(Max(Año)=Year(Today()),Month(Date(Today(),'MMM')),Date(Date#(Max(Mes),'MM'),'MMM')),Date(Date#(Max(Mes),'MM'),'MMM'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I use that in order to get today's value when there is no selection made at all???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 13:22:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-in-Wrong-Way/m-p/314724#M116136</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-24T13:22:19Z</dc:date>
    </item>
  </channel>
</rss>

