<?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 Using a variable in a set expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-a-set-expression/m-p/292234#M1179927</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks for all the help!&amp;nbsp; Finally got it to work using the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt; color: #808080;"&gt; &lt;/SPAN&gt;=sum({$&amp;lt;DateYear = {$(=Only(IslandYear))}&amp;gt;} Sales)&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Feb 2012 15:59:54 GMT</pubDate>
    <dc:creator>wnorwood</dc:creator>
    <dc:date>2012-02-20T15:59:54Z</dc:date>
    <item>
      <title>Using a variable in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-a-set-expression/m-p/292230#M1179923</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 am new to QlikView and I am trying to do something I think should be easy, but I just can't seem to get it to work.&amp;nbsp; I want to use a variable in my set expression.&amp;nbsp; The variable (vslandYear) is set to the the value selected from a list box that uses a data island.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use the actual year number like below, the expression works just fine.&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;DateYear = {2008}&amp;gt;} Sales)&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, I want to it to work more like this:&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;DateYear = {$(vIslandYear)}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This results in all 0's in the results.&amp;nbsp; Can anyone tell me what I am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 20:54:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-a-set-expression/m-p/292230#M1179923</guid>
      <dc:creator>wnorwood</dc:creator>
      <dc:date>2012-02-16T20:54:53Z</dc:date>
    </item>
    <item>
      <title>Using a variable in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-a-set-expression/m-p/292231#M1179924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you have not intialised the variable correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the Variable should be defiend in either of the two ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;vIslandYear = 2008&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-size: 12px; background-color: #eef4f9; font-family: Arial;"&gt;vIslandYear&amp;nbsp; =max(&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;DateYear &lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-size: 12px; background-color: #eef4f9; font-family: Arial;"&gt;I hope this resolves the issues&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-size: 12px; background-color: #eef4f9; font-family: Arial;"&gt;Deepak&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 22:00:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-a-set-expression/m-p/292231#M1179924</guid>
      <dc:creator>deepakk</dc:creator>
      <dc:date>2012-02-16T22:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-a-set-expression/m-p/292232#M1179925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use vIslandYear=Concat(Distinct DateYear,',');\\If you need to display with all the selected dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vIslandYear=Max(DateYear);\\To get the Maximum year from the selection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use expression as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;=sum({$&amp;lt;DateYear = {$(=vIslandYear)}&amp;gt;} Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;Hope it helps&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;Celambarasan&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 02:36:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-a-set-expression/m-p/292232#M1179925</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-02-17T02:36:38Z</dc:date>
    </item>
    <item>
      <title>Using a variable in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-a-set-expression/m-p/292233#M1179926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this expression for Variable&lt;/P&gt;&lt;P&gt;=Concat(DISTINCT Year,',')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this expression&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;Year = {$(=vYear)}&amp;gt;} Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 05:01:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-a-set-expression/m-p/292233#M1179926</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-02-17T05:01:33Z</dc:date>
    </item>
    <item>
      <title>Using a variable in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-a-set-expression/m-p/292234#M1179927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks for all the help!&amp;nbsp; Finally got it to work using the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt; color: #808080;"&gt; &lt;/SPAN&gt;=sum({$&amp;lt;DateYear = {$(=Only(IslandYear))}&amp;gt;} Sales)&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2012 15:59:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-a-set-expression/m-p/292234#M1179927</guid>
      <dc:creator>wnorwood</dc:creator>
      <dc:date>2012-02-20T15:59:54Z</dc:date>
    </item>
  </channel>
</rss>

