<?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 variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972537#M980580</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi KKR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue seems to be with the way my IT guys have created the variable - it doesn't use the Sales field. It's something like this (not exact):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vTotalSales = sum((Units&lt;STRONG&gt;UnitPrice)&lt;/STRONG&gt;ExchangeRate - (Discounts+ShippingIncome))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 22 Aug 2015 03:24:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-08-22T03:24:12Z</dc:date>
    <item>
      <title>Set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972531#M980574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a variable for total sales: vTotalSales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to know how to perform a set analysis on this variable, say restricting it to a year or particular country.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now, to display sales figures in a chart table I would write the following expression: =$(vTotalSales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How could I modify this to show only sales for, say, 2015? Nothing I've done so far seems to work.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 13:17:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972531#M980574</guid>
      <dc:creator />
      <dc:date>2015-08-21T13:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972532#M980575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The variable contains only a value, so you can restrict a field to a variable value, not a variable to a value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 15:20:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972532#M980575</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2015-08-21T15:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972533#M980576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't just "inject" set analysis into a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One approach could be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- A variable for the set analysis sentence: vSetModifier = '{$&amp;lt;Year = {2015}&amp;gt;}'&lt;/P&gt;&lt;P&gt;- A variable for the expression like: vTotalSales = Sum( $(vSetModifier) Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If vSetModifier = '' or null, the expression will work without any set analysis, else, will insert the set analysis modifier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this be useful for you...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 15:22:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972533#M980576</guid>
      <dc:creator>julian_rodriguez</dc:creator>
      <dc:date>2015-08-21T15:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972534#M980577</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;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;vTotalSales=&lt;/SPAN&gt;Sum({&amp;lt;YearField={2015}&amp;gt;}FieldSales) This you return all&amp;nbsp; sales into 2015&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;vTotalSales= &lt;/SPAN&gt;Sum({&amp;lt;YearField={2015},FieldCountry={'France'}&amp;gt;}FieldSales) This you return all&amp;nbsp; sales into 2015&amp;nbsp; but&amp;nbsp; only France&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 15:59:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972534#M980577</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-21T15:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972535#M980578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess the issue is that FieldSales field isn't being used. My developers have calculated net sales and put it into the variable above and this is being used instead of FieldSales. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2015 00:44:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972535#M980578</guid>
      <dc:creator />
      <dc:date>2015-08-22T00:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972536#M980579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's say the variable &lt;STRONG&gt;vTotalSales&lt;/STRONG&gt; definition is &lt;STRONG&gt;Sum(Sales)&lt;/STRONG&gt;. Change the definition to &lt;STRONG&gt;Sum($1 Sales)&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the chart expression write something like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;$(vTotalSales({&amp;lt;Year={2015}&amp;gt;}))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us know the result. Let me know if you need any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;KKR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2015 01:41:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972536#M980579</guid>
      <dc:creator />
      <dc:date>2015-08-22T01:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972537#M980580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi KKR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue seems to be with the way my IT guys have created the variable - it doesn't use the Sales field. It's something like this (not exact):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vTotalSales = sum((Units&lt;STRONG&gt;UnitPrice)&lt;/STRONG&gt;ExchangeRate - (Discounts+ShippingIncome))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2015 03:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variables/m-p/972537#M980580</guid>
      <dc:creator />
      <dc:date>2015-08-22T03:24:12Z</dc:date>
    </item>
  </channel>
</rss>

