<?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: Converting if/then to set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/405997#M151075</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;try this &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;=aggr(&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;[Date]&lt;/SPAN&gt;={&lt;SPAN style="color: #800000;"&gt;"&amp;gt;=$([DateEffStart])&amp;lt;=([DateEffEnd])"&lt;/SPAN&gt;}&amp;gt;}Sales),Sales&lt;SPAN style="color: #800000;"&gt;Index&lt;/SPAN&gt;))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Feb 2013 15:36:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-02-05T15:36:01Z</dc:date>
    <item>
      <title>Converting if/then to set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/405996#M151074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I am trying to convert this perfectly working If/Then to set analysis:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 10pt;"&gt;=Sum(If(Date &amp;gt;= DateEffStart and Date&amp;lt;= DateEffEnd, Aggr(Sales,SalesIndex))) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have tried the following which almost works, but appears to select the wrong dates:&amp;nbsp; (it is searching through a slowly changing date table)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;=&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;[Date]&lt;/SPAN&gt;={&lt;SPAN style="color: #800000;"&gt;"&amp;gt;=$([DateEffStart])&amp;lt;=([DateEffEnd])"&lt;/SPAN&gt;}&amp;gt;} &lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(Sales,Sales&lt;SPAN style="color: #800000;"&gt;Index&lt;/SPAN&gt;))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Is this even possible with set analysis?&amp;nbsp;&amp;nbsp; The if/then does work perfectly.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks very much for any insight!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 15:33:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/405996#M151074</guid>
      <dc:creator />
      <dc:date>2013-02-05T15:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Converting if/then to set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/405997#M151075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;try this &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;=aggr(&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;[Date]&lt;/SPAN&gt;={&lt;SPAN style="color: #800000;"&gt;"&amp;gt;=$([DateEffStart])&amp;lt;=([DateEffEnd])"&lt;/SPAN&gt;}&amp;gt;}Sales),Sales&lt;SPAN style="color: #800000;"&gt;Index&lt;/SPAN&gt;))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 15:36:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/405997#M151075</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-05T15:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Converting if/then to set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/405998#M151076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried this?&lt;/P&gt;&lt;P&gt;Sum(Aggr(Sum( {$&amp;lt;[Date]={"&amp;gt;=$([DateEffStart])&amp;lt;=$([DateEffEnd])"}&amp;gt;} Sales),SalesIndex))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 15:37:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/405998#M151076</guid>
      <dc:creator>Caique_Zaniolo</dc:creator>
      <dc:date>2013-02-05T15:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Converting if/then to set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/405999#M151077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately this did not work.&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&amp;nbsp; I tried it.&amp;nbsp; No value returned.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 15:45:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/405999#M151077</guid>
      <dc:creator />
      <dc:date>2013-02-05T15:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Converting if/then to set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/406000#M151078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is working the same way as the one i first posted.&amp;nbsp; It is returning the right sum, unfortunately when applying the total to other dimensions it seems to grab the first diminsion as opposed to the dimension of the date.&lt;/P&gt;&lt;P&gt;For example, if we are dealing with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Office&amp;nbsp;&amp;nbsp;&amp;nbsp; DateEffStart&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateEffEnd&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Miami&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6/1/2011&lt;/P&gt;&lt;P&gt;Chicago&amp;nbsp; 6/2/2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/6099&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Then totaling up the sales number by comparing the sales Date to the EffStart and end dates, if i using OFFICE as the dimension and the date on all the sales is 6/2/2011 or greater, the Office is coming back as Miami.&amp;nbsp; It should be Chicago.&amp;nbsp;&amp;nbsp; The if/then format correctly returns the office Chicago on the Sum(sales) number.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I am not sure why set analysis seems to just grab the first value, Miami in this case, as opposed to returning Chicago. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks SO much for your help everyone!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 15:51:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/406000#M151078</guid>
      <dc:creator />
      <dc:date>2013-02-05T15:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Converting if/then to set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/406001#M151079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;=aggr(&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #0000ff;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #800000;"&gt;[Date]&lt;/SPAN&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;={'&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #800000;"&gt;&amp;gt;=$(=[DateEffStart]) &amp;lt;= $(=[DateEffEnd])'&lt;/SPAN&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;}&amp;gt;}Sales),Sales&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #800000;"&gt;Index&lt;/SPAN&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Make sure format date fields is the same for each one&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 19:05:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-if-then-to-set-analysis/m-p/406001#M151079</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2013-02-05T19:05:54Z</dc:date>
    </item>
  </channel>
</rss>

