<?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: Using a variable in set analysis in Qlik Sense in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-a-variable-in-set-analysis-in-Qlik-Sense/m-p/1227609#M23930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christopher,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it work without use of variable ? Have you tired it first?&lt;/P&gt;&lt;P&gt;I mean if you put expression Year(MonthStart(Today(1)) - 1) - 1 directly into set analysis does it give you desired result?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so then you may try using variable following way,&lt;/P&gt;&lt;P&gt;LET v_prior_year = 'Year(MonthStart(Today(1)) - 1) - 1';&lt;/P&gt;&lt;P&gt;$(=$(=v_previous_year))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Sum({$&amp;lt;[Invoice Year]={$(=$(=v_previous_year))}&amp;gt;}[Ship Amount]) / Sum({$&amp;lt;[Invoice Year]={$(=$(=v_previous_year))}&amp;gt;}[Ship Quantity])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jan 2017 19:48:10 GMT</pubDate>
    <dc:creator>girirajsinh</dc:creator>
    <dc:date>2017-01-24T19:48:10Z</dc:date>
    <item>
      <title>Using a variable in set analysis in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-in-set-analysis-in-Qlik-Sense/m-p/1227607#M23928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use a variable in a set analysis expression. The variable is being set in my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET v_prior_year = Year(MonthStart(Today(1)) - 1) - 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the set analysis expression I am trying to get to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum({$&amp;lt;[Invoice Year]={$(=v_previous_year)}&amp;gt;}[Ship Amount]) / Sum({$&amp;lt;[Invoice Year]={$(=v_previous_year)}&amp;gt;}[Ship Quantity])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried different variations based on what I've read here, but none of them seem to work. I am using Qlik Sense 3.1. Any help is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 19:34:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-in-set-analysis-in-Qlik-Sense/m-p/1227607#M23928</guid>
      <dc:creator>chrishayes</dc:creator>
      <dc:date>2017-01-24T19:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in set analysis in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-in-set-analysis-in-Qlik-Sense/m-p/1227608#M23929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you check the value of v_prior_year in a KPI object? Does it gvie you 2016? May be you need another dollar sign expansion&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; font-size: 13px;"&gt;Sum({$&amp;lt;[Invoice Year]={$(=$(v_previous_year))}&amp;gt;}[Ship Amount]) / Sum({$&amp;lt;[Invoice Year]=&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{$(=$(v_previous_year))}&lt;/SPAN&gt;&amp;gt;}[Ship Quantity])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 19:42:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-in-set-analysis-in-Qlik-Sense/m-p/1227608#M23929</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-01-24T19:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in set analysis in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-in-set-analysis-in-Qlik-Sense/m-p/1227609#M23930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christopher,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it work without use of variable ? Have you tired it first?&lt;/P&gt;&lt;P&gt;I mean if you put expression Year(MonthStart(Today(1)) - 1) - 1 directly into set analysis does it give you desired result?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so then you may try using variable following way,&lt;/P&gt;&lt;P&gt;LET v_prior_year = 'Year(MonthStart(Today(1)) - 1) - 1';&lt;/P&gt;&lt;P&gt;$(=$(=v_previous_year))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Sum({$&amp;lt;[Invoice Year]={$(=$(=v_previous_year))}&amp;gt;}[Ship Amount]) / Sum({$&amp;lt;[Invoice Year]={$(=$(=v_previous_year))}&amp;gt;}[Ship Quantity])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 19:48:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-in-set-analysis-in-Qlik-Sense/m-p/1227609#M23930</guid>
      <dc:creator>girirajsinh</dc:creator>
      <dc:date>2017-01-24T19:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in set analysis in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-in-set-analysis-in-Qlik-Sense/m-p/1227610#M23931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry folks, it looks like I was using the wrong variable v_previous_year instead of v_prior_year. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/blush.png" /&gt; The former was null which I realized when checking the value in a KPI object. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 20:03:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-in-set-analysis-in-Qlik-Sense/m-p/1227610#M23931</guid>
      <dc:creator>chrishayes</dc:creator>
      <dc:date>2017-01-24T20:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in set analysis in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-in-set-analysis-in-Qlik-Sense/m-p/1227611#M23932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your variable should already hold the year value, so you won't need to expand using the equal sign:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Sum({$&amp;lt;[Invoice Year]={$(v_previous_year)}&amp;gt;}[Ship Amount]) / Sum({$&amp;lt;[Invoice Year]={$(v_previous_year)}&amp;gt;}[Ship Quantity])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 20:04:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-in-set-analysis-in-Qlik-Sense/m-p/1227611#M23932</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-01-24T20:04:07Z</dc:date>
    </item>
  </channel>
</rss>

