<?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 If vs Set Analysis Using Dimensions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745087#M453237</link>
    <description>&lt;P&gt;Pretty sure this is not possible, but wanted to double check.&lt;/P&gt;&lt;P&gt;My chart expression is:&lt;/P&gt;&lt;P&gt;=Sum(If([END DATE]&amp;gt;[MONTH YEAR] And [START DATE]&amp;lt;=[MONTH YEAR],[MEMBERSHIP FEE],0))&lt;/P&gt;&lt;P&gt;Making a chart where [MONTH YEAR] is the dimension to track memberships over time. This works. I cannot do this in Set Analysis, can I?&amp;nbsp;&lt;/P&gt;&lt;P&gt;A similar count expression that will work:&lt;/P&gt;&lt;P&gt;=Count(If([END DATE]&amp;gt;[MONTH YEAR] And [START DATE]&amp;lt;=[MONTH YEAR], [MEMBERSHIP NUM]))&lt;/P&gt;&lt;P&gt;Again, there is not a Set Analysis expression that will work.&lt;/P&gt;&lt;P&gt;Googling the forum suggests this is because Set Analysis only calculates once per chart?&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 23:57:21 GMT</pubDate>
    <dc:creator>timothyj</dc:creator>
    <dc:date>2024-11-15T23:57:21Z</dc:date>
    <item>
      <title>If vs Set Analysis Using Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745087#M453237</link>
      <description>&lt;P&gt;Pretty sure this is not possible, but wanted to double check.&lt;/P&gt;&lt;P&gt;My chart expression is:&lt;/P&gt;&lt;P&gt;=Sum(If([END DATE]&amp;gt;[MONTH YEAR] And [START DATE]&amp;lt;=[MONTH YEAR],[MEMBERSHIP FEE],0))&lt;/P&gt;&lt;P&gt;Making a chart where [MONTH YEAR] is the dimension to track memberships over time. This works. I cannot do this in Set Analysis, can I?&amp;nbsp;&lt;/P&gt;&lt;P&gt;A similar count expression that will work:&lt;/P&gt;&lt;P&gt;=Count(If([END DATE]&amp;gt;[MONTH YEAR] And [START DATE]&amp;lt;=[MONTH YEAR], [MEMBERSHIP NUM]))&lt;/P&gt;&lt;P&gt;Again, there is not a Set Analysis expression that will work.&lt;/P&gt;&lt;P&gt;Googling the forum suggests this is because Set Analysis only calculates once per chart?&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:57:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745087#M453237</guid>
      <dc:creator>timothyj</dc:creator>
      <dc:date>2024-11-15T23:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: If vs Set Analysis Using Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745106#M453238</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/50249"&gt;@timothyj&lt;/a&gt;&amp;nbsp; normally yes&amp;nbsp;Set Analysis only calculates once per chart ! but there is an alternative if I understood well the model.&lt;/P&gt;&lt;P&gt;suppose I have this sample, I know you have dates, it's the same logic.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 610px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40801i4F2C29C2F7057181/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;if I use your expression with if I have the output :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 672px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40802iBE32A82284B9FFCF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can get the same results with this set analysis :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;=Sum({&amp;lt;[MEMBERSHIP ID]={"=[END DATE]&amp;gt;[MONTH YEAR] And [START DATE]&amp;lt;=[MONTH YEAR]"}&amp;gt;} [MEMBERSHIP FEE])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 925px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40803i4F8A74882ADD39D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 14:04:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745106#M453238</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-09-18T14:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: If vs Set Analysis Using Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745134#M453239</link>
      <description>&lt;P&gt;With more data it does not work. Unsure why. I thought along those lines.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timothyj_0-1600439850796.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40809i661FA673A660EB17/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timothyj_0-1600439850796.png" alt="timothyj_0-1600439850796.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 14:39:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745134#M453239</guid>
      <dc:creator>timothyj</dc:creator>
      <dc:date>2020-09-18T14:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: If vs Set Analysis Using Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745139#M453240</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/50249"&gt;@timothyj&lt;/a&gt;&amp;nbsp; can you share the sample in Excel format for example ?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 14:42:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745139#M453240</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-09-18T14:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: If vs Set Analysis Using Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745140#M453241</link>
      <description>&lt;P&gt;This might view better.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Might work better." style="width: 658px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40812iC486C8F61FE559B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Might work better." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Might work better.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 14:42:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745140#M453241</guid>
      <dc:creator>timothyj</dc:creator>
      <dc:date>2020-09-18T14:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: If vs Set Analysis Using Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745142#M453243</link>
      <description>&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;MEMBERSHIP ID, END DATE, MONTH YEAR, START DATE, MEMBERSHIP FEE&lt;BR /&gt;101, 2/1/2001, 1/1/2001, 1/1/2001, 10&lt;BR /&gt;102, 5/1/2001, 1/1/2001, 1/1/2001, 10&lt;BR /&gt;103, 5/1/2001, 1/1/2001, 1/1/2001, 10&lt;BR /&gt;104, 2/1/2001, 1/1/2001, 1/1/2001, 10&lt;BR /&gt;102, 5/1/2001, 2/1/2001, 1/1/2001, 11&lt;BR /&gt;103, 5/1/2001, 2/1/2001, 1/1/2001, 11&lt;BR /&gt;105, 3/1/2001, 2/1/2001, 2/1/2001, 11&lt;BR /&gt;102, 5/1/2001, 3/1/2001, 1/1/2001, 12&lt;BR /&gt;103, 5/1/2001, 3/1/2001, 1/1/2001, 12&lt;BR /&gt;106, 4/1/2001, 3/1/2001, 3/1/2001, 12&lt;BR /&gt;107, 5/1/2001, 3/1/2001, 3/1/2001, 12&lt;BR /&gt;102, 5/1/2001, 4/1/2001, 1/1/2001, 13&lt;BR /&gt;103, 5/1/2001, 4/1/2001, 1/1/2001, 13&lt;BR /&gt;107, 5/1/2001, 4/1/2001, 3/1/2001, 13&lt;BR /&gt;108, 5/1/2001, 4/1/2001, 4/1/2001, 13&lt;BR /&gt;];&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 14:44:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745142#M453243</guid>
      <dc:creator>timothyj</dc:creator>
      <dc:date>2020-09-18T14:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: If vs Set Analysis Using Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745148#M453244</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/50249"&gt;@timothyj&lt;/a&gt;&amp;nbsp; to work this properly in set analysis you may need to evaluate your set expression on primary key of your data. So if you already have primary key field in your data you can refer to that in set analysis like below&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=Count({&amp;lt; &lt;STRONG&gt;Primary_Key&lt;/STRONG&gt; ={"=[END DATE]&amp;gt;[MONTH YEAR] And [START DATE]&amp;lt;=[MONTH YEAR]"}&amp;gt;}[MEMBERSHIP NUM])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you don't have primary key and unsure of what is the primary key then you can simply create the key in load script with simple rowno() function like below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LOAD ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;rowno() as &lt;STRONG&gt;Primary_Key&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can now refer this primary key in set analysis as same way described above. You can similarly use it for sum function as well&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=sum({&amp;lt; &lt;STRONG&gt;Primary_Key&lt;/STRONG&gt; ={"=[END DATE]&amp;gt;[MONTH YEAR] And [START DATE]&amp;lt;=[MONTH YEAR]"}&amp;gt;}[MEMBERSHIP FEE])&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 14:50:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745148#M453244</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-09-18T14:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: If vs Set Analysis Using Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745150#M453245</link>
      <description />
      <pubDate>Fri, 18 Sep 2020 14:54:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745150#M453245</guid>
      <dc:creator>timothyj</dc:creator>
      <dc:date>2020-09-18T14:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: If vs Set Analysis Using Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745156#M453246</link>
      <description>&lt;P&gt;Bingo, that made&amp;nbsp;&lt;SPAN&gt;Taoufiq&amp;nbsp;'s formula work.&amp;nbsp; I will add that to the much larger data set that loops through way to many months.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Who gets the correct solution tag? We have a joint effort! More questions!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 15:00:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745156#M453246</guid>
      <dc:creator>timothyj</dc:creator>
      <dc:date>2020-09-18T15:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: If vs Set Analysis Using Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745164#M453247</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/50249"&gt;@timothyj&lt;/a&gt;&amp;nbsp; you can mark as many replies as solution and it's your choice which one to mark.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 15:10:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745164#M453247</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-09-18T15:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: If vs Set Analysis Using Dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745262#M453254</link>
      <description>&lt;P&gt;Teamwork! Thank you&amp;nbsp;&lt;SPAN&gt;Taoufiq &amp;amp; Kush! I ran it through the big data set adding the RowNo() Key and had success!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you both for helping folks out!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 18:57:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-vs-Set-Analysis-Using-Dimensions/m-p/1745262#M453254</guid>
      <dc:creator>timothyj</dc:creator>
      <dc:date>2020-09-18T18:57:13Z</dc:date>
    </item>
  </channel>
</rss>

