<?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 Problem with Set Analisys formula in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-Set-Analisys-formula/m-p/233132#M504206</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;I have a problem with set analysis formula. I try to calculate the valid accounts at month end. I have a calendar table that has a field, MontEnd, calculated as&lt;/P&gt;&lt;P&gt;IF(DayStart(TempDate) = DayStart(MonthEnd(TempDate)),MonthEnd(TempDate)) &lt;B&gt;AS&lt;/B&gt; MonthEnd&lt;/P&gt;&lt;P&gt;If I write the stock as&lt;/P&gt;&lt;P&gt;=&lt;B&gt;Count&lt;/B&gt;(&lt;B&gt;distinct&lt;/B&gt; &lt;B&gt;IF&lt;/B&gt;(&lt;B&gt;MonthEnd&lt;/B&gt;=&lt;B&gt;date&lt;/B&gt;(&lt;B&gt;MonthEnd&lt;/B&gt;(&lt;B&gt;AddMonths&lt;/B&gt;(&lt;B&gt;Today&lt;/B&gt;(),-1))),&lt;B&gt;ACCOUNT&lt;/B&gt;))&lt;/P&gt;&lt;P&gt;I have the right values. If I try to write the same thing with set analysis formula below I have 0 for all dimensions.&lt;BR /&gt;=&lt;STRONG&gt;Count&lt;/STRONG&gt;({$&amp;lt;&lt;STRONG&gt;MonthEnd&lt;/STRONG&gt;={&lt;STRONG&gt;&lt;I&gt;$(#=date(MonthEnd(AddMonths(Today(),-1))))&lt;/I&gt;&lt;/STRONG&gt;}&amp;gt;} &lt;STRONG&gt;DISTINCT&lt;/STRONG&gt; &lt;STRONG&gt;ACCOUNT&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;Please, can you tell me the write syntax of set analysis in this case?&lt;/P&gt;&lt;P&gt;Thank you all very much!&lt;/P&gt;&lt;P&gt;Best regards&lt;B&gt;,&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Adelaida&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Feb 2010 12:39:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-02-08T12:39:04Z</dc:date>
    <item>
      <title>Problem with Set Analisys formula</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Set-Analisys-formula/m-p/233132#M504206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;I have a problem with set analysis formula. I try to calculate the valid accounts at month end. I have a calendar table that has a field, MontEnd, calculated as&lt;/P&gt;&lt;P&gt;IF(DayStart(TempDate) = DayStart(MonthEnd(TempDate)),MonthEnd(TempDate)) &lt;B&gt;AS&lt;/B&gt; MonthEnd&lt;/P&gt;&lt;P&gt;If I write the stock as&lt;/P&gt;&lt;P&gt;=&lt;B&gt;Count&lt;/B&gt;(&lt;B&gt;distinct&lt;/B&gt; &lt;B&gt;IF&lt;/B&gt;(&lt;B&gt;MonthEnd&lt;/B&gt;=&lt;B&gt;date&lt;/B&gt;(&lt;B&gt;MonthEnd&lt;/B&gt;(&lt;B&gt;AddMonths&lt;/B&gt;(&lt;B&gt;Today&lt;/B&gt;(),-1))),&lt;B&gt;ACCOUNT&lt;/B&gt;))&lt;/P&gt;&lt;P&gt;I have the right values. If I try to write the same thing with set analysis formula below I have 0 for all dimensions.&lt;BR /&gt;=&lt;STRONG&gt;Count&lt;/STRONG&gt;({$&amp;lt;&lt;STRONG&gt;MonthEnd&lt;/STRONG&gt;={&lt;STRONG&gt;&lt;I&gt;$(#=date(MonthEnd(AddMonths(Today(),-1))))&lt;/I&gt;&lt;/STRONG&gt;}&amp;gt;} &lt;STRONG&gt;DISTINCT&lt;/STRONG&gt; &lt;STRONG&gt;ACCOUNT&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;Please, can you tell me the write syntax of set analysis in this case?&lt;/P&gt;&lt;P&gt;Thank you all very much!&lt;/P&gt;&lt;P&gt;Best regards&lt;B&gt;,&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Adelaida&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 12:39:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Set-Analisys-formula/m-p/233132#M504206</guid>
      <dc:creator />
      <dc:date>2010-02-08T12:39:04Z</dc:date>
    </item>
    <item>
      <title>Problem with Set Analisys formula</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Set-Analisys-formula/m-p/233133#M504207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Adelaida,&lt;/P&gt;&lt;P&gt;Syntax seems to be ok for me. But I may change&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;$(#=date&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;for &lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;$(=date&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;as I'm not sure about comparing a datefield with date format (as you are getting in your load script) stored in Monthend field with the numeric value returned by the preceding "#" in your set analysis. &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;By the way, I would suggest you to change the name of the field MonthEnd, as this is, as well, the name of a function, which can mislead QlikView when operating (set analysis or whatever) try to distinguish beyween function name and field name. This may be likely affecting your set analysis.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 13:19:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Set-Analisys-formula/m-p/233133#M504207</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-02-08T13:19:39Z</dc:date>
    </item>
    <item>
      <title>Problem with Set Analisys formula</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Set-Analisys-formula/m-p/233134#M504208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adelaida,&lt;/P&gt;&lt;P&gt;the set analysis formula should look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count({$&amp;lt;MonthEnd={$(='"'&amp;amp;date(MonthEnd(AddMonths(Today(),-1)))&amp;amp;'"')}&amp;gt;} DISTINCT ACCOUNT)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Milda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 13:27:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Set-Analisys-formula/m-p/233134#M504208</guid>
      <dc:creator />
      <dc:date>2010-02-08T13:27:24Z</dc:date>
    </item>
    <item>
      <title>Problem with Set Analisys formula</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Set-Analisys-formula/m-p/233135#M504209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Milda!! It works!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 13:45:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Set-Analisys-formula/m-p/233135#M504209</guid>
      <dc:creator />
      <dc:date>2010-02-08T13:45:52Z</dc:date>
    </item>
  </channel>
</rss>

