<?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 question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/258217#M496692</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a date field (that in QlikView is numeric) instead of a year month field (that is a string, and as such takes longer to process) in the set analysis expression:&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"&gt;&lt;P&gt;Sum({1&amp;lt; DateField = {"&amp;gt;=$(=MonthStart(Today()))&amp;lt;=$(=MonthEnd(Today()))"} &amp;gt;} Transamount)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will return the sum of values in Transamount where DateField (your date field) is between the start and end of current month. But even faster is to create a flag field in your script, so the current month is always identified, something like&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"&gt;&lt;P&gt;CalendarTable:&lt;/P&gt;&lt;P&gt;LOAD ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(InMonth(&lt;EM&gt;DateFieldorExpressionHere, &lt;/EM&gt;Today()), 1, 0) AS CurrentMonthFlag,&lt;/P&gt;&lt;P&gt;... // rest of the script here&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So 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"&gt;&lt;P&gt;Sum({1&amp;lt; CurrentMonthFlag = {1} &amp;gt;} Transamount)&lt;/P&gt;&lt;/PRE&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>Sat, 07 Jan 2012 19:47:01 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2012-01-07T19:47:01Z</dc:date>
    <item>
      <title>Set analysis question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/258214#M496689</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;&lt;/P&gt;&lt;P&gt;At this moment I use the following expression: sum({1}if(MonthYear=num(Month(Today())) &amp;amp;'-'&amp;amp; Year(Today()), Transamount)).&lt;/P&gt;&lt;P&gt;This gives me the oppurtinity to show the revenue for the current month. The problem is that it gives me to much, so I want to put this in a set analysis.&lt;/P&gt;&lt;P&gt;Can anyone give me the right expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Henco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jan 2012 15:43:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/258214#M496689</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-07T15:43:15Z</dc:date>
    </item>
    <item>
      <title>Set analysis question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/258215#M496690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have a look at the Set Analysis Wizard&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://tools.qlikblog.at/SetAnalysisWizard/QlikView-SetAnalysis_Wizard_and_Generator.aspx"&gt;http://tools.qlikblog.at/SetAnalysisWizard/QlikView-SetAnalysis_Wizard_and_Generator.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It can help you generate the right statement!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Fabian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jan 2012 17:19:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/258215#M496690</guid>
      <dc:creator>fheidenstecker</dc:creator>
      <dc:date>2012-01-07T17:19:30Z</dc:date>
    </item>
    <item>
      <title>Set analysis question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/258216#M496691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabian, thats a great tool but unfortunately I can't get it done. When I fill I get this expression: Sum({1&amp;lt;Jaar={'Year(Today())'},Maand={'num(month(today())'}&amp;gt;}Transamount) but that one doesnt work. Can you help me with this specific set analysis? Kind regards, Henco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jan 2012 17:59:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/258216#M496691</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-07T17:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/258217#M496692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a date field (that in QlikView is numeric) instead of a year month field (that is a string, and as such takes longer to process) in the set analysis expression:&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"&gt;&lt;P&gt;Sum({1&amp;lt; DateField = {"&amp;gt;=$(=MonthStart(Today()))&amp;lt;=$(=MonthEnd(Today()))"} &amp;gt;} Transamount)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will return the sum of values in Transamount where DateField (your date field) is between the start and end of current month. But even faster is to create a flag field in your script, so the current month is always identified, something like&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"&gt;&lt;P&gt;CalendarTable:&lt;/P&gt;&lt;P&gt;LOAD ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(InMonth(&lt;EM&gt;DateFieldorExpressionHere, &lt;/EM&gt;Today()), 1, 0) AS CurrentMonthFlag,&lt;/P&gt;&lt;P&gt;... // rest of the script here&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So 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"&gt;&lt;P&gt;Sum({1&amp;lt; CurrentMonthFlag = {1} &amp;gt;} Transamount)&lt;/P&gt;&lt;/PRE&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>Sat, 07 Jan 2012 19:47:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/258217#M496692</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-01-07T19:47:01Z</dc:date>
    </item>
  </channel>
</rss>

