<?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 Using fields in Set Analysis modifiers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805150#M284273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just fresh off a Set Analysis class, I was asked for the sum of all forecasted sales since the Companystartdate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I entered:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;[OppStartDate]={"&amp;gt;=Companystartdate"}&amp;gt;} FORAMT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This returned uniform zeroes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed it to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= sum(if(OppStartDate&amp;gt;=Companystartdate,FORAMT,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked perfectly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I use a field name like CompanyStartDate in the SA analysis above? do I need $-expansion here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't have time to practice right now, so if anyone has a quick answer, I'd appreciate it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Feb 2015 16:44:41 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-02-13T16:44:41Z</dc:date>
    <item>
      <title>Using fields in Set Analysis modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805150#M284273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just fresh off a Set Analysis class, I was asked for the sum of all forecasted sales since the Companystartdate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I entered:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;[OppStartDate]={"&amp;gt;=Companystartdate"}&amp;gt;} FORAMT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This returned uniform zeroes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed it to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= sum(if(OppStartDate&amp;gt;=Companystartdate,FORAMT,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked perfectly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I use a field name like CompanyStartDate in the SA analysis above? do I need $-expansion here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't have time to practice right now, so if anyone has a quick answer, I'd appreciate it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 16:44:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805150#M284273</guid>
      <dc:creator />
      <dc:date>2015-02-13T16:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using fields in Set Analysis modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805151#M284274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The right side of set analysis can include field names but must represent a unique value that is you could use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Companystartdate) or Only(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Companystartdate) but in set analysis you cannot compare directly 2 fields ...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 16:46:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805151#M284274</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2015-02-13T16:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using fields in Set Analysis modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805152#M284275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well, neither max nor only worked, but at least now I know what the issue is. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the quick response! I have it working with sum(if(.. so I'll just leave it at that, and come back to this another time. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 16:52:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805152#M284275</guid>
      <dc:creator />
      <dc:date>2015-02-13T16:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using fields in Set Analysis modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805153#M284276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The difference between the IF and the Set Analysis is that the IF statement is being performed for each row of data, while the Set Analysis condition is performed once per chart. To be precise, your modifier &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[OppStartDate]={"&amp;gt;=Companystartdate"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;is working as an implied AGGR by the field [OppStartDate]. So, the comparison should be valid for each distinct value of OppStartDate. If I were to guess, I'd try something like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;OppoertunityID={"=&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[OppStartDate]&lt;/SPAN&gt;&amp;gt;=Companystartdate"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;This condition will select those Opportunities where the field OppStartDate is greater then the Companystartdate.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Another possible solution would be to use an aggregation function inside a dollar-sign expansion:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;OppoertunityID={"=&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[OppStartDate]&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;gt;=$(=min(Companystartdate))"}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Lastly, check the date formats for the two fields. Set Analysis is a bit picky when it comes to comparing date fields - the formats have to be exactly the same.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Oleg Troyansky&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Come and learn Set Analysis and Advanced Aggregation with me at &lt;STRONG&gt;www.masterssummit.com&lt;/STRONG&gt; - take your QlikView skills to the next level!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 16:52:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805153#M284276</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2015-02-13T16:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using fields in Set Analysis modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805154#M284277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Oleg. that gives me something to work on when I come back to this. One further quick question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do you mean create OppID as a variable, or as a new field (e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;                if(OppStartDate&amp;gt;=CompStartDate,1,0) As OppID,&lt;/P&gt;&lt;P&gt;                *;&lt;/P&gt;&lt;P&gt;(select opp table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then build my SA statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 16:58:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805154#M284277</guid>
      <dc:creator />
      <dc:date>2015-02-13T16:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using fields in Set Analysis modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805155#M284278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have multiple potential values within CompStartDate then yes I would create that field, from there the set analysis if very simple and spans across all companies in your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you only have a single CompStartDate then using the only(CompStartDate ) option should work for you.&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;[OppStartDate]={"&amp;gt;=$(=Only(Companystartdate))"}&amp;gt;} FORAMT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope that helps&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 17:15:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805155#M284278</guid>
      <dc:creator />
      <dc:date>2015-02-13T17:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using fields in Set Analysis modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805156#M284279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example, I made up a field that identifies the Opportunity, assuming that you have something like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, you bring up even a better point. If you calculate the condition in the script and save the result in a flag field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Load&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(OppStartDate&amp;gt;=CompStartDate,1,0) As _OppDate_Flag,&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;(select opp table)&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Then you can simplify your Set Analysis by a lot:&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;_OppDate_Flag = {1}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;Or, you can simply multiply your measure by the same flag, without using set analysis&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 17:38:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805156#M284279</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2015-02-13T17:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using fields in Set Analysis modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805157#M284280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep, many ways to skin a cat. I wanted to use my new toy, but as has been pointed out, since there’s a different Company start date for each company, SA may not be the best choice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I appreciate all the answers – gives me a better understanding!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 18:05:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-fields-in-Set-Analysis-modifiers/m-p/805157#M284280</guid>
      <dc:creator />
      <dc:date>2015-02-13T18:05:33Z</dc:date>
    </item>
  </channel>
</rss>

