<?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: Assistance in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Assistance-in-set-analysis/m-p/362158#M134618</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Miguel,&lt;/P&gt;&lt;P&gt;Thanks for the helpful answer.&lt;BR /&gt;Can you advise on what should I change in the this set analysis if I would like to let to user choose the base month?&lt;BR /&gt;For example, if the user will choose sale month May, than I should present the sales in the current year from Jenuary till April (without May).&lt;BR /&gt;Field are: Sale_Month, Sale_Date.&lt;BR /&gt;Thanks again,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jun 2012 21:56:29 GMT</pubDate>
    <dc:creator>david_ze</dc:creator>
    <dc:date>2012-06-22T21:56:29Z</dc:date>
    <item>
      <title>Assistance in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Assistance-in-set-analysis/m-p/362155#M134615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'd like to show all sales for the current year, with the exception of the selected month (if not selected than the current month will be the exception),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fields are:&lt;/P&gt;&lt;P&gt;Year, Month, Total_Sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll appreciate you assistance on this,&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 09:44:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assistance-in-set-analysis/m-p/362155#M134615</guid>
      <dc:creator>david_ze</dc:creator>
      <dc:date>2012-06-21T09:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Assistance-in-set-analysis/m-p/362156#M134616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this what you&amp;nbsp; are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Year={$(=Max(Year))},Month=&amp;gt;} Total_Sales)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;Deepak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 09:54:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assistance-in-set-analysis/m-p/362156#M134616</guid>
      <dc:creator>deepakk</dc:creator>
      <dc:date>2012-06-21T09:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Assistance-in-set-analysis/m-p/362157#M134617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming you have a Date field based on Year and Month, the result should be a range in set analysis:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13402772213016038" jivemacro_uid="_13402772213016038"&gt;&lt;P&gt;Sum({&amp;lt; Date = {"&amp;gt;=$(=YearStart(Today()))&amp;lt;=$(=MonthEnd(AddMonths(Today(), -1)))"} &amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That builds a range from the first day of the current year to the last day of the previous month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's even easier to create a flag field in the script so if Year equals to Year(Today()) and the date is less than or equal to the previous month date the value is set to 1, otherwise is set to 0. Then the expression is simplified to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13402772213008834" jivemacro_uid="_13402772213008834"&gt;&lt;P&gt;Sum({&amp;lt; IsCurrent = {1} &amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a general rule and best practice, do this sort of flag fields as often as possible, in order to simplify expressions and get better performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 11:06:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assistance-in-set-analysis/m-p/362157#M134617</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-06-21T11:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Assistance-in-set-analysis/m-p/362158#M134618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Miguel,&lt;/P&gt;&lt;P&gt;Thanks for the helpful answer.&lt;BR /&gt;Can you advise on what should I change in the this set analysis if I would like to let to user choose the base month?&lt;BR /&gt;For example, if the user will choose sale month May, than I should present the sales in the current year from Jenuary till April (without May).&lt;BR /&gt;Field are: Sale_Month, Sale_Date.&lt;BR /&gt;Thanks again,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 21:56:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assistance-in-set-analysis/m-p/362158#M134618</guid>
      <dc:creator>david_ze</dc:creator>
      <dc:date>2012-06-22T21:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Assistance-in-set-analysis/m-p/362159#M134619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use to do that using a variable instead of a field. For example, you create a new Calendar object, using a variable vDateSelected instead of a field, that lets the user select any given month and populate it (or you can use an inputbox as well).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in your expressions, the Date field is always depending on the selection by the user:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13406072482307887" jivemacro_uid="_13406072482307887"&gt;&lt;P&gt;Sum({&amp;lt; Date = {'&amp;gt;=$(=YearStart(vDateSelected))'} &amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find more on set analysis and variables in &lt;A _jive_internal="true" href="https://community.qlik.com/community.qlik.com/qlikviews/1075"&gt;this application&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 07:11:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assistance-in-set-analysis/m-p/362159#M134619</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-06-25T07:11:32Z</dc:date>
    </item>
  </channel>
</rss>

