<?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 Table (Straight or pivot) how to calculate a measure without some dimensions on the line in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Table-Straight-or-pivot-how-to-calculate-a-measure-without-some/m-p/1786635#M61350</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;They ask my a table (with drill/down) with these Dimensions :&lt;/P&gt;&lt;P&gt;- Promotion type&lt;BR /&gt;- Brand&lt;BR /&gt;- Article&lt;BR /&gt;The measures :&lt;/P&gt;&lt;P&gt;- Sales Week 1&lt;BR /&gt;- Sales Week 2&lt;BR /&gt;- Sales Week 3&lt;BR /&gt;- Sales Week 4&lt;BR /&gt;- Average Sales per week of the last 12 months&lt;BR /&gt;- Evolution between the Sales and the Average Sales (x4)&lt;BR /&gt;If my product A is on promotion this month, i must calculated the average sales for this product on last 12 months either in promotion or not.&lt;/P&gt;&lt;P&gt;In my data model a sale is tagged with the promotion type if the date of the sale is between the promotion period. So if i select a promotion type, all the sales with this promotion type are selected. All the sales don't have a promotion type !&lt;/P&gt;&lt;P&gt;My formula is :&amp;nbsp;&lt;/P&gt;&lt;P&gt;sum( {1 &amp;lt;[Date]={"&amp;lt;$(=MonthStart(today())) &amp;gt;=$(=MonthStart(AddYears(today(),-1))) "},[Promotion.Type]=&amp;nbsp; &amp;gt;}[Sales.Qty]) / 52&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the set analysis&amp;nbsp;&lt;STRONG&gt;[Promotion.Type]=&lt;/STRONG&gt;&amp;nbsp; is to take all values for promotion type but i must ignore this dimension in my calcul because i want to have the sales that not have this tag too.&lt;/P&gt;&lt;P&gt;Qlik add all cnk that was in promotion last year in my table. The sales Calculated is only the sales on promotion for the products.&lt;/P&gt;&lt;P&gt;Ex :&lt;/P&gt;&lt;P&gt;- Product A is on promotion this month (250 sales this week) but never been in promotion last year. The sales for product A&amp;nbsp; last year was 5200. In my table i have Avg/week : 0 This week : 250 Iwould like to have Avg/week : 100 This week : 250&lt;BR /&gt;- Product B is not on promotion this month. The Sales last year was 2600 with 520 in promotion.&lt;BR /&gt;In my table Avg/week : 10 This week : 0. I don't want to see product B in my table&lt;/P&gt;&lt;P&gt;How to avoid that ? How to keep only the product in promotion this month and calculate the total sales last year for these products&amp;nbsp; only ?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;BR /&gt;Bet regards,&lt;BR /&gt;Stephane&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2021 15:11:00 GMT</pubDate>
    <dc:creator>StephaneP</dc:creator>
    <dc:date>2021-02-26T15:11:00Z</dc:date>
    <item>
      <title>Table (Straight or pivot) how to calculate a measure without some dimensions on the line</title>
      <link>https://community.qlik.com/t5/App-Development/Table-Straight-or-pivot-how-to-calculate-a-measure-without-some/m-p/1786635#M61350</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;They ask my a table (with drill/down) with these Dimensions :&lt;/P&gt;&lt;P&gt;- Promotion type&lt;BR /&gt;- Brand&lt;BR /&gt;- Article&lt;BR /&gt;The measures :&lt;/P&gt;&lt;P&gt;- Sales Week 1&lt;BR /&gt;- Sales Week 2&lt;BR /&gt;- Sales Week 3&lt;BR /&gt;- Sales Week 4&lt;BR /&gt;- Average Sales per week of the last 12 months&lt;BR /&gt;- Evolution between the Sales and the Average Sales (x4)&lt;BR /&gt;If my product A is on promotion this month, i must calculated the average sales for this product on last 12 months either in promotion or not.&lt;/P&gt;&lt;P&gt;In my data model a sale is tagged with the promotion type if the date of the sale is between the promotion period. So if i select a promotion type, all the sales with this promotion type are selected. All the sales don't have a promotion type !&lt;/P&gt;&lt;P&gt;My formula is :&amp;nbsp;&lt;/P&gt;&lt;P&gt;sum( {1 &amp;lt;[Date]={"&amp;lt;$(=MonthStart(today())) &amp;gt;=$(=MonthStart(AddYears(today(),-1))) "},[Promotion.Type]=&amp;nbsp; &amp;gt;}[Sales.Qty]) / 52&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the set analysis&amp;nbsp;&lt;STRONG&gt;[Promotion.Type]=&lt;/STRONG&gt;&amp;nbsp; is to take all values for promotion type but i must ignore this dimension in my calcul because i want to have the sales that not have this tag too.&lt;/P&gt;&lt;P&gt;Qlik add all cnk that was in promotion last year in my table. The sales Calculated is only the sales on promotion for the products.&lt;/P&gt;&lt;P&gt;Ex :&lt;/P&gt;&lt;P&gt;- Product A is on promotion this month (250 sales this week) but never been in promotion last year. The sales for product A&amp;nbsp; last year was 5200. In my table i have Avg/week : 0 This week : 250 Iwould like to have Avg/week : 100 This week : 250&lt;BR /&gt;- Product B is not on promotion this month. The Sales last year was 2600 with 520 in promotion.&lt;BR /&gt;In my table Avg/week : 10 This week : 0. I don't want to see product B in my table&lt;/P&gt;&lt;P&gt;How to avoid that ? How to keep only the product in promotion this month and calculate the total sales last year for these products&amp;nbsp; only ?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;BR /&gt;Bet regards,&lt;BR /&gt;Stephane&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 15:11:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Table-Straight-or-pivot-how-to-calculate-a-measure-without-some/m-p/1786635#M61350</guid>
      <dc:creator>StephaneP</dc:creator>
      <dc:date>2021-02-26T15:11:00Z</dc:date>
    </item>
  </channel>
</rss>

