<?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: How to calculate Sales Weight Calculation in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544342#M109668</link>
    <description>&lt;P&gt;Try to play with aggr() and even more simplified expressions to comprehend how the general logic is working. Means attempts like:&lt;/P&gt;&lt;P&gt;sum(Sales)&lt;BR /&gt;sum(aggr(sum(Sales), Sector))&lt;BR /&gt;sum(aggr(sum(Sales), Sector, Year))&lt;/P&gt;&lt;P&gt;whereby Sales means the origin field and not the master-measure. The first steps don't need any conditions - they could be added later again step by step.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Mar 2026 08:40:14 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2026-03-09T08:40:14Z</dc:date>
    <item>
      <title>How to calculate Sales Weight</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544050#M109633</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I received a requirement to calculate &lt;STRONG&gt;weighted availability&lt;/STRONG&gt;, meaning:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;The percentage of total sales in the stores where the selected product is sold, out of the total sales across all stores.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The expression needs to be displayed in two charts:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;A Bar chart with &lt;EM&gt;Sector&lt;/EM&gt; as the dimension.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;A Line chart with &lt;EM&gt;Sector&lt;/EM&gt; and &lt;EM&gt;Year&lt;/EM&gt; as dimensions.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I was able to create the bar chart using the following expression:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;({1&amp;lt;[Material]=P({1&amp;lt;[Product_Division]={'10','12','13','16','26','30','35'}&amp;gt;}[Material]), CustKey=P({&amp;lt;[Customers.Name] -= {"*Marlog*"}, [Customer_H6_Desc.]={'Private'}&amp;gt;} CustKey),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;, Year = $::Year&amp;gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[Sales])&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;/&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{1&amp;lt; [Material]=P({1&amp;lt;[Product_Division]={'10','12','13','16','26','30','35','40'}&amp;gt;}[Material]), CustKey = P({1&amp;lt;[Customers.Name] -= {"*Marlog*"}, [Customer_H6_Desc.]={'Private'}&amp;gt;}CustKey), Year = $::Year&amp;gt;}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[Sales]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;However, I was not able to make it work properly for the line chart.&lt;/P&gt;&lt;P&gt;There are Three additional constraints:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;[Sales] is already a master measure and cannot be modified.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The line chart should ignore Year selection (So the trend will always be visible).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;There may be selections on different product levels (Category, Barcode, etc.).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I would appreciate a solution &lt;U&gt;or&lt;/U&gt; an alternative expression that might work better in this scenario.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 13:16:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544050#M109633</guid>
      <dc:creator>sogloqlik</dc:creator>
      <dc:date>2026-03-10T13:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales Weight Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544194#M109644</link>
      <description>&lt;P&gt;May be try this&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sum(&lt;/P&gt;&lt;P&gt;{&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Year=,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Material = P({&amp;lt;[Product_Division]={'10','12','13','16','26','30','35'}&amp;gt;} Material),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CustKey = P({&amp;lt;[Customers.Name] -= {"*Marlog*"}, [Customer_H6_Desc.]={'Private'}&amp;gt;} CustKey)&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;/P&gt;&lt;P&gt;[Sales]&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;Sum(&lt;/P&gt;&lt;P&gt;{&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Year=,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CustKey = P({&amp;lt;[Customers.Name] -= {"*Marlog*"}, [Customer_H6_Desc.]={'Private'}&amp;gt;} CustKey)&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;/P&gt;&lt;P&gt;TOTAL &amp;lt;Sector,Year&amp;gt; [Sales]&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2026 14:16:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544194#M109644</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2026-03-04T14:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales Weight Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544200#M109647</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Chanty4u,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your answer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As i wrote in my original post, Sales is alreay a measure (With Sum) and nested aggrigation is not allowed.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2026 14:40:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544200#M109647</guid>
      <dc:creator>sogloqlik</dc:creator>
      <dc:date>2026-03-04T14:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales Weight Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544243#M109658</link>
      <description>&lt;P&gt;I suggest to use a table-chart with both dimensions and both expression-parts in parallel. The aim of it is to see which parts are working as expected and which not. And the not working ones may then splitted into n further parts.&lt;/P&gt;&lt;P&gt;Next steps may be to integrate only the master-measure and/or parts of it as further expressions. These reduced expressions could be the starting point for some adjustments and/or wrapping them with further aggregations by using some aggr() constructs.&lt;/P&gt;&lt;P&gt;The simplified complexity of such an approach is usually much more helpful as the efforts for n extra steps.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2026 16:36:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544243#M109658</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2026-03-05T16:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales Weight Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544303#M109664</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Already done that, the issue is the numerator but I Havn't managed to solve the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2026 08:16:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544303#M109664</guid>
      <dc:creator>sogloqlik</dc:creator>
      <dc:date>2026-03-08T08:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales Weight Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544342#M109668</link>
      <description>&lt;P&gt;Try to play with aggr() and even more simplified expressions to comprehend how the general logic is working. Means attempts like:&lt;/P&gt;&lt;P&gt;sum(Sales)&lt;BR /&gt;sum(aggr(sum(Sales), Sector))&lt;BR /&gt;sum(aggr(sum(Sales), Sector, Year))&lt;/P&gt;&lt;P&gt;whereby Sales means the origin field and not the master-measure. The first steps don't need any conditions - they could be added later again step by step.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2026 08:40:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544342#M109668</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2026-03-09T08:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales Weight Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544407#M109683</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I appriciate your help but was hoping for more of a final answer since i had done all of these steps before posting.&lt;/P&gt;&lt;P&gt;The issue is that becase the set analysis is calculated per chart, it does not consider the dimansion (Year) value. you were right about using Aggr but somehow it didn't solve it.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 06:25:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544407#M109683</guid>
      <dc:creator>sogloqlik</dc:creator>
      <dc:date>2026-03-10T06:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales Weight Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544415#M109685</link>
      <description>&lt;P&gt;There is a misunderstanding in the way how the data interact with each other.&lt;/P&gt;&lt;P&gt;A set analysis doesn't work per object else globally against the selection state respectively n alternate states - and it is always a selection. It won't influence the relationship between the data.&lt;/P&gt;&lt;P&gt;An aggr() could be used to create a new not existing relationship between the data - even connecting not related data in a cartesian way would be possible. This feature is very powerful but it has also some complexity and performance-impact. It's not really sensible to apply it for things which could be done within the data-model.&lt;/P&gt;&lt;P&gt;Beside this be aware that your set analysis connects two states -&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Year = $::Year&lt;/EM&gt;&lt;/STRONG&gt; - which may conflicting with the states in the master-measure and which may also be considered within an aggr-approach.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 07:58:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544415#M109685</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2026-03-10T07:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales Weight Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544431#M109686</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First of all, thank you again for your patience.&lt;/P&gt;&lt;P&gt;I decided to drop the measure-based approach and instead work directly with the field itself. I came up with two simple alternatives:&lt;/P&gt;&lt;P&gt;Sum({1&amp;lt; [Material]=, [Customer] = P([Customer]) &amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;Sum({&amp;lt; [Material]=, Category=, [Customer] = P([Customer]) &amp;gt;} Sales)&lt;BR /&gt;(This option avoids using {1} and still allows filtering fields such as Category.)&lt;/P&gt;&lt;P&gt;When I filter both Year and Category, both expressions return the expected results.&lt;/P&gt;&lt;P&gt;However, when I filter only Category, the calculation seems to include all customers who ever bought a product from that category, and then performs the aggregation across all years.&lt;/P&gt;&lt;P&gt;What I actually need is for the expression to evaluate the customers separately for each year when no Year filter is applied.&lt;/P&gt;&lt;P&gt;What would be the correct way to adjust the set analysis so that the customer set is calculated per year, even when Year is not explicitly selected?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 11:56:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544431#M109686</guid>
      <dc:creator>sogloqlik</dc:creator>
      <dc:date>2026-03-10T11:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales Weight Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544479#M109688</link>
      <description>&lt;P&gt;In the most scenarios a statement like: ... Field = p(Field) ... isn't necessary because it's just transferring the selection state which is already by default considered. But if the p() itself get a set statement like: ... Field = p({ SET } Field) ... it would be possible to define more complex selection states.&lt;/P&gt;&lt;P&gt;I could imagine that your expression may go in such direction:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum(aggr(Sum({&amp;lt; [Material]=, Category= &amp;gt;} Sales),&amp;nbsp;[Customer], [Year]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;which calculates a sales-result per customer and year.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 15:45:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544479#M109688</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2026-03-10T15:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales Weight Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544598#M109702</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The formula works, including for a master measure. I got stuck on trying to use P() and didn’t take a step back to realize that the solution was actually much simpler.&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2026 15:24:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544598#M109702</guid>
      <dc:creator>sogloqlik</dc:creator>
      <dc:date>2026-03-11T15:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Sales Weight</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544954#M109764</link>
      <description>&lt;P&gt;Thank you for the information.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 10:47:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-Sales-Weight/m-p/2544954#M109764</guid>
      <dc:creator>Sunilsahu_345</dc:creator>
      <dc:date>2026-03-17T10:47:48Z</dc:date>
    </item>
  </channel>
</rss>

