<?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 Set Analysis syntax in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-syntax/m-p/17876#M2945</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 want to perform a simple task: compare some expression of current month to last year's same month:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use this set analysis expression to get the sum of the ful month of last year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;=sum({$&amp;lt; myDate={'&amp;lt;=$(=date(monthend (addmonths(max(MyDate),-12))))'},&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;myDate={'&amp;gt;=$(=date(monthstart (addmonths(max(MyDate),-12))))'}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &amp;gt;} [myExpression])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;but oddly the value displayed is the same as sum([myExpression])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I checked that outside the set analysis, date(monthstart (addmonths(max(MyDate),-12))) and date(monthend (addmonths(max(MyDate),-12))) are showing the correct dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I have something wrong with my syntax, but can't figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Olivier&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Mar 2018 10:22:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-03-13T10:22:42Z</dc:date>
    <item>
      <title>Set Analysis syntax</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-syntax/m-p/17876#M2945</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 want to perform a simple task: compare some expression of current month to last year's same month:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use this set analysis expression to get the sum of the ful month of last year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;=sum({$&amp;lt; myDate={'&amp;lt;=$(=date(monthend (addmonths(max(MyDate),-12))))'},&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;myDate={'&amp;gt;=$(=date(monthstart (addmonths(max(MyDate),-12))))'}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &amp;gt;} [myExpression])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;but oddly the value displayed is the same as sum([myExpression])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I checked that outside the set analysis, date(monthstart (addmonths(max(MyDate),-12))) and date(monthend (addmonths(max(MyDate),-12))) are showing the correct dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I have something wrong with my syntax, but can't figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Olivier&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 10:22:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-syntax/m-p/17876#M2945</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-13T10:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis syntax</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-syntax/m-p/17877#M2946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't have the same field more than once in a set modifier. You specify myDate twice - and that is not allowed and I believe that QlikView normally only takes into consideration the last one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To combine the criteria you can write it like this:&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;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;=sum({$&amp;lt; myDate={'&amp;lt;=$(=date(monthend (addmonths(max(MyDate),-12))))&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; font-size: 13.3333px; font-style: inherit; font-weight: inherit;"&gt;&amp;gt;=$(=date(monthstart (addmonths(max(MyDate),-12))))'}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&amp;gt;} [myExpression])&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;And secondly it looks like you reference both myDate and MyDate and QlikView is case sensitive so it expects these to be two different fields... I don't know what you think about that should it be one field - then you need to select one or the other variant. Meaning make the single field named myDate or MyDate according to your data model.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 10:32:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-syntax/m-p/17877#M2946</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-03-13T10:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis syntax</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-syntax/m-p/17878#M2947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot write single dimension in 2 parts for analysis tool. You may try like this?&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;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;sum({$&amp;lt; myDate={"&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;gt;=$(=date(monthstart (addmonths(max(MyDate),-12))))&lt;/SPAN&gt; &amp;lt;=$(=date(monthend (addmonths(max(MyDate),-12))))'}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG style="font-size: 10pt;"&gt;&amp;gt;} [myExpression])&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 10:33:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-syntax/m-p/17878#M2947</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-03-13T10:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis syntax</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-syntax/m-p/17879#M2948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this answer (the myDate and MyDate was a typo), but I still cannot manage to have it working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I streamlined my case in this script (I included all the default SET... part as it may influence the way dates are handled)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET ThousandSep=',';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET DecimalSep='.';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET MoneyThousandSep=',';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET MoneyDecimalSep='.';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET MoneyFormat='£#,##0.00;-£#,##0.00';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET TimeFormat='hh:mm:ss';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET DateFormat='DD/MM/YYYY';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET FirstWeekDay=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET BrokenWeeks=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET ReferenceDay=4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET FirstMonthOfYear=1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET CollationLocale='en-GB';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Load * inline [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;mydate,value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;01/12/2017, 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;02/12/2017,20&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;01/12/2016, 30&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;03/12/2016,40&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;10/12/2016,50&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I would like to display this table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 391px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="58" width="83"&gt; &lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="119"&gt;sum(value)&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="189"&gt;sum(value current month)/sum(value of the month of last year)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;dec-17&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;dec-16&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;120&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me figure out the set analysis code to get the 0.25 (=30/120)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 18:07:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-syntax/m-p/17879#M2948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-13T18:07:22Z</dc:date>
    </item>
  </channel>
</rss>

