<?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: P() and e() in set analysis with condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1339035#M412698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it, try this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(DISTINCT{&amp;lt;[Session ID] = p({&amp;lt;Flag = {0}&amp;gt;}[Session ID]), Flag = {1}, Category = e(Category), Key = {"=Avg({&amp;lt;Category&amp;gt;}Flag) = 1"}&amp;gt;}[Session ID])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where Key is created in the script like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;[Session ID]&amp;amp; Category as Key,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Len(Trim(InvoiceID)) = 0, 1, 0) as Flag;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Session ID, InvoiceID ,ItemID, Category,sesion_start,log_datetime&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1111, 2, 219, E,2017-01-01 11:30:30,&amp;nbsp;&amp;nbsp;&amp;nbsp; 2017-01-01 11:30:39&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1111, 2, 220, DL,2017-01-01 11:30:31,&amp;nbsp;&amp;nbsp;&amp;nbsp; 2017-01-01 11:30:29&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Aug 2017 11:19:16 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-08-03T11:19:16Z</dc:date>
    <item>
      <title>P() and e() in set analysis with condition</title>
      <link>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1339032#M412695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have the following sample data &lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/172237_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;by using the following expression:&lt;/P&gt;&lt;P&gt;=Count(DISTINCT{&amp;lt;Category = p({&amp;lt;Category, [Session ID] = p([Session ID]), Flag = {0}&amp;gt;}), Flag = {0}, [Session ID] = p({&amp;lt;Flag = {1}&amp;gt;})*e( {&amp;lt;Flag = {0}&amp;gt;})&amp;gt;}[Session ID])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i was able to achieve:&lt;/P&gt;&lt;P&gt;like below:&lt;/P&gt;&lt;P&gt;when selected category E at the list box,( considering all session_id that have the selected category) the chart count 1 for the category dimension when:&lt;/P&gt;&lt;P&gt; 0 item of category E was sold, but the display category have&amp;gt;=1 items sold &lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture3.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/172240_Capture3.JPG" style="height: 222px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i cannot achieve the opposite like below:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;when selected category E at the list box,&lt;SPAN style="font-size: 13.3333px;"&gt; considering all session_id that have the selected category)&lt;SPAN style="font-size: 13.3333px;"&gt;the chart count 1 for the category dimension when:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;gt;=1 items of the selected category sold but 0 items of the display category was sold.&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;the result using the above data would be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;when selected E, the chart should show:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;R:1( count from session 5555)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;W:1&lt;SPAN style="font-size: 13.3333px;"&gt;( count from session 1111)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Q:1&lt;SPAN style="font-size: 13.3333px;"&gt;( count from session 1111)&lt;/SPAN&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;when select DB, the chart should show:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;E:1&lt;SPAN style="font-size: 13.3333px;"&gt;( count from session 3620)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Q:1&lt;SPAN style="font-size: 13.3333px;"&gt;( count from session 3620)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&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;when select Q, the chart should show:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;R: 1&lt;SPAN style="font-size: 13.3333px;"&gt;( count from session 5555)&lt;/SPAN&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;Any one can help solve this problem.....???&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2017 14:38:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1339032#M412695</guid>
      <dc:creator />
      <dc:date>2017-08-02T14:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: P() and e() in set analysis with condition</title>
      <link>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1339033#M412696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure that when E is selected, you are hoping to get&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;&lt;STRONG&gt;R:1( count from session 5555)&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-size: 13.3333px; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;W:1&lt;SPAN style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;( count from session 1111)&lt;/SPAN&gt;&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&gt;Q:1&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG&gt;( count from session 1111)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;and not&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-style: inherit; font-family: inherit; font-weight: 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;STRONG&gt;R:2( count from session 4444, 5555)&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-size: 13.3333px; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;W:1&lt;SPAN style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;( count from session 1111)&lt;/SPAN&gt;&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-size: 13.3333px; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;Q:1&lt;SPAN style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;( count from session 1111)&lt;/SPAN&gt;&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-size: 13.3333px; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;STRONG&gt;JL:1&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;STRONG&gt;( count from session 1111)&lt;/STRONG&gt;&lt;/SPAN&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;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I got the above using this expression....&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;=Count(DISTINCT{&amp;lt;[Session ID] = p({&amp;lt;Flag = {0}&amp;gt;}[Session ID]), Flag = {1}, Category = e(Category)&amp;gt;}[Session ID])&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;But didn't know why R from 4444 and JL from 1111 not included?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2017 17:50:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1339033#M412696</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-08-02T17:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: P() and e() in set analysis with condition</title>
      <link>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1339034#M412697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Sunny, thanks for your reply,&lt;/P&gt;&lt;P&gt;When E is selected R from 4444 is not include because there is an item R is sold in that session(the item id of the R category wirh flag=0 should have another item id say 290 to indicate that it is 2 different item from the same category)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also JL from 1111 is not include becaise there is another JL category sold in the same session....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count 1 when the selected category have&amp;gt;=1 items sold, and the displayed category have no items of that category sold.....&lt;/P&gt;&lt;P&gt;dont know if my description is clear enough....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2017 02:45:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1339034#M412697</guid>
      <dc:creator />
      <dc:date>2017-08-03T02:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: P() and e() in set analysis with condition</title>
      <link>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1339035#M412698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it, try this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(DISTINCT{&amp;lt;[Session ID] = p({&amp;lt;Flag = {0}&amp;gt;}[Session ID]), Flag = {1}, Category = e(Category), Key = {"=Avg({&amp;lt;Category&amp;gt;}Flag) = 1"}&amp;gt;}[Session ID])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where Key is created in the script like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;[Session ID]&amp;amp; Category as Key,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Len(Trim(InvoiceID)) = 0, 1, 0) as Flag;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Session ID, InvoiceID ,ItemID, Category,sesion_start,log_datetime&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1111, 2, 219, E,2017-01-01 11:30:30,&amp;nbsp;&amp;nbsp;&amp;nbsp; 2017-01-01 11:30:39&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1111, 2, 220, DL,2017-01-01 11:30:31,&amp;nbsp;&amp;nbsp;&amp;nbsp; 2017-01-01 11:30:29&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2017 11:19:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1339035#M412698</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-08-03T11:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: P() and e() in set analysis with condition</title>
      <link>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1339036#M412699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for late reply.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/check.png" /&gt;Thanks Sunny!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2017 14:36:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1339036#M412699</guid>
      <dc:creator />
      <dc:date>2017-08-04T14:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: P() and e() in set analysis with condition</title>
      <link>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1525056#M438335</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can i get any solution for the below condition using P()&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(vAbsoluteThrshold=0,-1,fabs(sum({&amp;lt;$(='[$(premiumField)]')))&amp;gt;=vAbsolutethreshold)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Dec 2018 08:47:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-and-e-in-set-analysis-with-condition/m-p/1525056#M438335</guid>
      <dc:creator>smithaprabhakar</dc:creator>
      <dc:date>2018-12-31T08:47:50Z</dc:date>
    </item>
  </channel>
</rss>

