<?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: Pivot Table - RangeSum for Dimensionality() 1 in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1981984#M81037</link>
    <description>&lt;P&gt;Aggr() should be the right approach - means something like:&lt;/P&gt;
&lt;P&gt;sum(aggr(YourExpression, Dim1, Dim2))&lt;/P&gt;
&lt;P&gt;whereby Dim1, Dim2 are placeholder for the needed dimensionality in which context the calculation should be happens. Quite often it are the dimensions used within the chart but sometimes it may even another/further ones like on a lower granularity and/or including any selections.&lt;/P&gt;
&lt;P&gt;- Marcus&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 13:11:56 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2022-09-16T13:11:56Z</dc:date>
    <item>
      <title>Pivot Table - RangeSum for Dimensionality() 1</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1981673#M81008</link>
      <description>&lt;P&gt;Desired Outcome:&amp;nbsp; Display a total at the Team level for all SalesTypes for the first column/Forecasted Leads to Close.&lt;/P&gt;
&lt;P&gt;Issue:&amp;nbsp; Normally Qlik would display the total, however, in my case I have different ConversionRates per SalesType, therefore, Qlik cannot calculate the total.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-09-15 132605.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/89216i4DFC6229F61196E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-09-15 132605.png" alt="Screenshot 2022-09-15 132605.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Sample calculation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(Count({&amp;lt;Last4Weeks = {'1'}&amp;gt;} OpportunityCount) / 4) 
* (Sum({&amp;lt;Status = {'New Client'}, Last4Weeks = {'1'}&amp;gt;} OpportunityCount) / Sum({&amp;lt;Last4Weeks = {'1'}&amp;gt;} OpportunityCount)) 
* ConversionRate&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Calculation reads, over the last 4 weeks, sum the leads then divide by 4 to get an average per week.&amp;nbsp; Then multiply that by the percentage of New Client opportunities.&amp;nbsp; Then multiply that by the ConversionRate to determine a forecasted lead count to be won.&lt;/P&gt;
&lt;P&gt;5 leads per week * 86% are New Clients leads * 65% Conversion Rate = ~3 New Client leads will convert to the next stage in the lead life cycle.&lt;/P&gt;
&lt;P&gt;My specific issue is with the ConversionRate.&amp;nbsp; &lt;SPAN&gt;There is no aggregation on the ConversionRate (min, max, sum).&amp;nbsp; If I do Max, a total displays but it isn't the correct value.&amp;nbsp; Same holds true for the others.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;So I started going down the path of RangeSum().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=If(Dimensionality() = 1,
RangeSum(Below(Column(1)), 1, NoOfRows()),
// Other calculation here //
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried it with Aggr and other combinations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone have an insight on how to properly count the SalesTypes and display the count in the Team level?&lt;/P&gt;
&lt;P&gt;I can provide the inline loads and calculations if needed.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!!&lt;/P&gt;
&lt;P&gt;Chrissy&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 17:47:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1981673#M81008</guid>
      <dc:creator>chrissy</dc:creator>
      <dc:date>2022-09-15T17:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table - RangeSum for Dimensionality() 1</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1981885#M81025</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/197656"&gt;@chrissy&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Can you provide an app with the inline loads and the pivot with your calculations?&lt;BR /&gt;I will take a look at it.&lt;/P&gt;
&lt;P&gt;-Ruben&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:08:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1981885#M81025</guid>
      <dc:creator>Ruhulessin</dc:creator>
      <dc:date>2022-09-16T09:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table - RangeSum for Dimensionality() 1</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1981984#M81037</link>
      <description>&lt;P&gt;Aggr() should be the right approach - means something like:&lt;/P&gt;
&lt;P&gt;sum(aggr(YourExpression, Dim1, Dim2))&lt;/P&gt;
&lt;P&gt;whereby Dim1, Dim2 are placeholder for the needed dimensionality in which context the calculation should be happens. Quite often it are the dimensions used within the chart but sometimes it may even another/further ones like on a lower granularity and/or including any selections.&lt;/P&gt;
&lt;P&gt;- Marcus&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:11:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1981984#M81037</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-09-16T13:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table - RangeSum for Dimensionality() 1</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1985637#M81371</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/34638"&gt;@Ruhulessin&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;
&lt;P&gt;Thank you for your assistance.&amp;nbsp; I don't have access to grab the actual Qlik file but here is the script.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SalesLeads:
Load *
Inline [
    Team, SalesType, LeadCount, Status, Last4Weeks
    Team 1, Outbound Sales, 250, New Client, 1
    Team 1, Inbound Sales, 25, New Client, 1
    Team 1, Inbound Sales, 50, Add Ons, 1
    Team 1, Renewals, 24, Renewals, 1
    Team 2, Outbound Sales, 163, New Client, 1
    Team 2, Inbound Sales, 36, New Client, 1
    Team 2, Inbound Sales, 42, Add Ons, 1
    Team 2, Renewals, 10, Renewals, 1
    Team 2, Add Ons, 15, Renewals, 1
];

Left Join (SalesLeads)
Load *
Inline [
    SalesType, ConversionRate
    Outbound Sales, .25
    Inbound Sales, .45
    Renewals, .8
    Add Ons, .95
];&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then it is a pivot table with Team and&amp;nbsp;SalesType as the dimensions.&amp;nbsp; I have since dumbed down the calculation to 'Count(LeadCount) * ConversionRate'.&amp;nbsp; The issue is the ConversionRate not being aggregated.&amp;nbsp; So it doesn't matter too much what the first part of the calculation is.&lt;/P&gt;
&lt;P&gt;Appreciate the assistance!!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 20:53:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1985637#M81371</guid>
      <dc:creator>chrissy</dc:creator>
      <dc:date>2022-09-26T20:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table - RangeSum for Dimensionality() 1</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1985640#M81373</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;
&lt;P&gt;Thanks for your suggestion.&amp;nbsp; The 'YourExpression' is where I am seeing the issue.&amp;nbsp; Part of the set analysis isn't in a Sum, Max, etc.&amp;nbsp; Therefore, it doesn't work at the top dimension.&lt;/P&gt;
&lt;P&gt;ConversionRate is a multiplier per SalesType (lowest level) and not by Team (highest level).&lt;/P&gt;
&lt;P&gt;Thanks for any additional insight.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 20:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1985640#M81373</guid>
      <dc:creator>chrissy</dc:creator>
      <dc:date>2022-09-26T20:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table - RangeSum for Dimensionality() 1</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1985796#M81392</link>
      <description>&lt;P&gt;All relevant dimension must be added within the aggr() - at least the lowest level on which the calculation needs to be performed. Beside this it could be that you don't only need a set analysis within the inner aggregation else also within the outer aggregation and further also an optional TOTAL statement - means something like:&lt;/P&gt;
&lt;P&gt;sum({&amp;lt; OuterSet &amp;gt;} TOTAL &amp;lt;Dim, Dim2&amp;gt; aggr(count({&amp;lt; InnerSet &amp;gt;} Field), Dim3, Dim4))&lt;/P&gt;
&lt;P&gt;Depending on your data + data-model and the requirements to build the UI view it might even be to wrap the aggr() with another aggr() and/or to query the dimensionality() to branch into different different calculations. Yes, such approaches could become quite complex and therefore I suggest to consider in any parts of the logic could be transferred into the script to simplify the UI.&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 07:37:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1985796#M81392</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-09-27T07:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table - RangeSum for Dimensionality() 1</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1986217#M81470</link>
      <description>&lt;P&gt;Thank you for your assistance.&amp;nbsp; This solution worked great!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 20:01:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-Table-RangeSum-for-Dimensionality-1/m-p/1986217#M81470</guid>
      <dc:creator>chrissy</dc:creator>
      <dc:date>2022-09-27T20:01:18Z</dc:date>
    </item>
  </channel>
</rss>

