<?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() &amp; E() Set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053113#M353280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Btw, not tested (maybe later I have time to test and improve performance) but it can be something like:&lt;/P&gt;&lt;P&gt;Sum(if(MONTHNAME=DISCH_MONTH_NM, QUANTITY))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A sample would be nice to return a tested answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Feb 2016 13:02:46 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2016-02-17T13:02:46Z</dc:date>
    <item>
      <title>P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053111#M353278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The below is my Data Model.Vistis are joined to Charges table by Account ID. &lt;/P&gt;&lt;P&gt;Charges Table is joined to Calendar on POST DATE.&lt;/P&gt;&lt;P&gt;I have created an Independent Calendar to do the analysis.&lt;/P&gt;&lt;P&gt;Here is the problem, &lt;/P&gt;&lt;P&gt;When user selects a month from independent calendar, I want to fetch the same month from DISCH_MONTH_NM(Visit Table) and then fetch the possible &lt;SPAN style="font-size: 13.3333px;"&gt;Account IDs &lt;/SPAN&gt;&amp;amp; then Calculating the &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Quantity for all those Accounts.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Data Model.png" class="jive-image image-1" src="/legacyfs/online/114949_Data Model.png" style="height: 455px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;In the UI Level , I created a Straight table like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Tableview.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/114954_Tableview.png" style="height: 192px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st Expression : Only(MONTHNAME)&amp;nbsp; -- to Check weather it is fetching one value&lt;/P&gt;&lt;P&gt;2nd Expression : COUNT(DISTINCT if(MONTHNAME=DISCH_MONTH_NM, [Account ID]))&amp;nbsp; -- To check the number of Account IDs&lt;/P&gt;&lt;P&gt;3rd Expression : sum({&amp;lt;&lt;SPAN style="font-size: 13.3333px;"&gt;[Account ID]&lt;/SPAN&gt;=P({&amp;lt;DISCH_MONTH_NM ={'$(=only(MONTHNAME))'}&amp;gt;}&lt;SPAN style="font-size: 13.3333px;"&gt;[Account ID]&lt;/SPAN&gt;)&amp;gt;} QUANTITY)&amp;nbsp; -- To fetch Quantity&lt;/P&gt;&lt;P&gt;But the 3rd Expression is not working...&lt;/P&gt;&lt;P&gt;Can any one correct this expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 11:39:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053111#M353278</guid>
      <dc:creator />
      <dc:date>2016-02-17T11:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053112#M353279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jhansi, $-expanded expressions and set analysis are calculated for the whole table, not row by row. QV tries to expand the $-expression and it found different values for MONTHNAME so it returns null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you hover the mouse over the column title you'll see something like:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;&lt;SPAN style="font-size: 13.3333px;"&gt;[Account ID]&lt;/SPAN&gt;=P({&amp;lt;DISCH_MONTH_NM =&lt;STRONG&gt;{''}&lt;/STRONG&gt;&amp;gt;}&lt;SPAN style="font-size: 13.3333px;"&gt;[Account ID]&lt;/SPAN&gt;)&amp;gt;} QUANTITY)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'If' version is calculated row by row. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 12:58:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053112#M353279</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2016-02-17T12:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053113#M353280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Btw, not tested (maybe later I have time to test and improve performance) but it can be something like:&lt;/P&gt;&lt;P&gt;Sum(if(MONTHNAME=DISCH_MONTH_NM, QUANTITY))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A sample would be nice to return a tested answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:02:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053113#M353280</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2016-02-17T13:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053114#M353281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably just need to copy the possible values from your data island to the Visits&amp;nbsp; table month field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;DISCH_MONTH_NM = p(MONTHNAME) &amp;gt;} QUANTITY)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:06:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053114#M353281</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-17T13:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053115#M353282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There could be a problem with the formatting of the month... If so, you may consider formatting both months as integers and use these in the set analysis. Do the DISCH_MONTH_NM and MONTHNAME have the same format?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But first: What does your label show? Here you can see if the dollar-expansion has worked the way you want.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Image3.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/114958_Image3.png" style="height: 192px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further, why do you keep the calendar as a logical island. I think a canonical date would be better. See &lt;A href="https://community.qlik.com/qlik-blogpost/3585"&gt;Canonical Date&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:07:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053115#M353282</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2016-02-17T13:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053116#M353283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. What you have explained is correct. It could not fetch the Month Values from MONTHNAME (Master table).&lt;/P&gt;&lt;P&gt;So What should be the right expression to reflect the value?&lt;/P&gt;&lt;P&gt;Thank you for responding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:35:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053116#M353283</guid>
      <dc:creator />
      <dc:date>2016-02-17T13:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053117#M353284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not working properly.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Tableview1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/114970_Tableview1.png" style="height: 203px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:45:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053117#M353284</guid>
      <dc:creator />
      <dc:date>2016-02-17T13:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053118#M353285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is working in a Text Object and giving the right result as shown in screen shot.&lt;/P&gt;&lt;P&gt;But giving the total amount for all the values.&lt;IMG alt="Tableview1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/114971_Tableview1.png" style="height: 203px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:49:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053118#M353285</guid>
      <dc:creator />
      <dc:date>2016-02-17T13:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053119#M353286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Henric for responding. As you stated. the expression that i have written is giving output as below screenshot.&lt;/P&gt;&lt;P&gt;Instead of using $(=only(DISCH_MONTH_NM)) , I should use some expression to pull the correct month. Could you make a suggest? Thanks a lot in advance.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Tableview2.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/114976_Tableview2.png" style="height: 247px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 14:40:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053119#M353286</guid>
      <dc:creator />
      <dc:date>2016-02-17T14:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053120#M353287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can any one have an idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 15:25:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053120#M353287</guid>
      <dc:creator />
      <dc:date>2016-02-17T15:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053121#M353288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As mentioned before, the set analysis is evaluated once per chart, not per dimension line.&lt;/P&gt;&lt;P&gt;So you can't have a set expression consider your dimension values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[When you select a single MONTHNAME, the dollar sign expansions should return a value, and the dimension should be limited to this value as well. Your sum should return the correct result (but this only works because your dimension is limited to a single value, same single possible value as you can retrieve in global context)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use a Sum(If(..)) construct instead, or try what I've suggested above (assigning the possible MONTHNAME values using p() function to DISCH_MONTH_NM), or look into the different approaches that Henric suggested.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 21:07:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053121#M353288</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-17T21:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053122#M353289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can see that the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=only(MONTHNAME) has failed to evaluate - it only shows {'-'} - which means that no value is assigned to DISCH_MONTH_NM. The reason is that it is expanded before the chart is built. Also I suspect that you will have have problems since the field is in a logical island. &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;I think that you should consider removing the logical island and instead use a canonical date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 21:33:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053122#M353289</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2016-02-17T21:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: P() &amp; E() Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053123#M353290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I made a quick sample emulating you model. Added a new month-year field to the charges table to use in the If() comparison, PFA.&lt;/P&gt;&lt;P&gt;Consider to use the canonical date proposed by Henric to avoid the If() inside the Sum()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 23:42:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-E-Set-analysis/m-p/1053123#M353290</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2016-02-17T23:42:53Z</dc:date>
    </item>
  </channel>
</rss>

