<?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: Set Analysis with a Variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-a-Variable/m-p/695932#M251471</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK... jamie is right in that its easier to just add an '=' on the front of your variable. The SET ANALYSIS syntax will be simpler and it may actually start working by just adding an =.&amp;nbsp; To be sure you'd have to share the QVW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT.. its not 100% necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following syntax is also valid for a variable that does not have a preceding =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(&amp;nbsp;&amp;nbsp; {$&amp;lt;Date={$(='"&amp;gt;=' &amp;amp; $(vStartofYear) &amp;amp; '"') }&amp;gt;} Sales) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This evaluates to the following (see screenshot with red circle) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this situation you are and building the entire SET MODIFIER formula from scratch which IS possible but a bit of a pain.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just had to nerd out there and get this out of my system &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/68654_Untitled.png" style="width: 620px; height: 429px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Oct 2014 02:18:55 GMT</pubDate>
    <dc:creator>JonnyPoole</dc:creator>
    <dc:date>2014-10-10T02:18:55Z</dc:date>
    <item>
      <title>Set Analysis with a Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-a-Variable/m-p/695928#M251467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to build a line chart that always displays data for the current fiscal year only.&amp;nbsp; I'm using Set Analysis because I don't want the user to have to select the months/year from a list box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fiscal year starts on 10/1 every year (10/1/14 to 9/30/15 is this fiscal year).&amp;nbsp; I have created a variable that calculates the first day of the fiscal year (vFiscalYearStartDay).&amp;nbsp; I tested my variable with a text box and it seems to be calculating properly:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Variable Test.jpg" class="jive-image" height="149" src="/legacyfs/online/68614_Variable Test.jpg" style="width: 323px; height: 148.595641646489px;" width="323" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I put it in my expression, it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I tried:&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt; [Transaction Date] ={"&amp;gt;=$(=vFiscalYearStartDay)"}&amp;gt;} Amount) &lt;/P&gt;&lt;P&gt;I get a 'No Data to Display' error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I manually put the date into the expression like this:&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt; [Transaction Date] ={"&amp;gt;=10/1/2014"}&amp;gt;} Amount) &lt;/P&gt;&lt;P&gt;and it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me what I am doing wrong ?&amp;nbsp;&amp;nbsp; I've never tried Set Analysis with a variable so this is all new to me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 19:56:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-a-Variable/m-p/695928#M251467</guid>
      <dc:creator />
      <dc:date>2014-10-09T19:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with a Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-a-Variable/m-p/695929#M251468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;What is the exact variable definition?&amp;nbsp; does it have an '=' in the front or no.&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;For example this works for me:&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;vFiscalDate variable formula:&amp;nbsp;&amp;nbsp; =yearstart(max(Date))&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;successful chart expression:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =Sum(&amp;nbsp; {$&amp;lt;Date = { "&amp;gt;=$(vFiscalDate)"}&amp;gt;} Sales)&amp;nbsp; &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;&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;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 20:07:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-a-Variable/m-p/695929#M251468</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-10-09T20:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with a Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-a-Variable/m-p/695930#M251469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This:&lt;/P&gt;&lt;P&gt;If($(Qvc.IsLeapYear)=1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Num(month(today()))&amp;gt;=10,Date(YearStart(Today()+364)-92),Date(YearStart(Today())-92,)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Num(month(today()))&amp;gt;=10,Date(YearStart(Today()+365)-92),Date(YearStart(Today())-92,))&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No equal sign.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 20:40:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-a-Variable/m-p/695930#M251469</guid>
      <dc:creator />
      <dc:date>2014-10-09T20:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with a Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-a-Variable/m-p/695931#M251470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In order to make your formula work, you have to precalculate what it's inside your variable. Actually that's what the "=" at the beginning of the variable definition means.&lt;/P&gt;&lt;P&gt;For example a variable defined as Date(today()) and another one =date(today()) would behave differently depending on the context where you use each variable. The first will calculate date(today()) inside the chart everytime a user makes a selection. The second option will precalculate date(today()) and the chart where you use this variable will receive just the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In you case you need that the variable you use, returns you a number or any result, so set analysis can use this value. That's why you need to use a "=" (precalculate) at the beginning of your variable definition,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 21:09:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-a-Variable/m-p/695931#M251470</guid>
      <dc:creator>jaimeaguilar</dc:creator>
      <dc:date>2014-10-09T21:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with a Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-a-Variable/m-p/695932#M251471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK... jamie is right in that its easier to just add an '=' on the front of your variable. The SET ANALYSIS syntax will be simpler and it may actually start working by just adding an =.&amp;nbsp; To be sure you'd have to share the QVW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT.. its not 100% necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following syntax is also valid for a variable that does not have a preceding =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(&amp;nbsp;&amp;nbsp; {$&amp;lt;Date={$(='"&amp;gt;=' &amp;amp; $(vStartofYear) &amp;amp; '"') }&amp;gt;} Sales) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This evaluates to the following (see screenshot with red circle) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this situation you are and building the entire SET MODIFIER formula from scratch which IS possible but a bit of a pain.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just had to nerd out there and get this out of my system &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/68654_Untitled.png" style="width: 620px; height: 429px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 02:18:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-a-Variable/m-p/695932#M251471</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-10-10T02:18:55Z</dc:date>
    </item>
  </channel>
</rss>

