<?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 Pivot Table Sub totals in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Sub-totals/m-p/1753779#M718744</link>
    <description>&lt;P&gt;I have a pivot table I have created.&amp;nbsp; The requirement is to have Net Sales/Margin down the side and broken up by months across the top with YTD last year, YTD this year and Variance at the end.&amp;nbsp; No problems with that.&amp;nbsp; This issue is getting a subtotal.&amp;nbsp; It will only display the subtotal for the Net Margin % and not both Net Sales and Margin %.&lt;/P&gt;&lt;P&gt;My dimension for Net Sales/Margin % is the following:&lt;/P&gt;&lt;P&gt;=ValueList('Net Sales','Net Margin %')&lt;/P&gt;&lt;P&gt;I have three other dimensions along the left-hand side that are just the dimensions selected, not calculated dimensions.&lt;/P&gt;&lt;P&gt;My expression for one of the months is the following:&lt;/P&gt;&lt;P&gt;If(ValueList('Net Sales','Net Margin %')='Net Sales',&lt;/P&gt;&lt;P&gt;Num(sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;}NetSales ),'$###,###,##0'),&lt;/P&gt;&lt;P&gt;Num((sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;}NetMargin )&lt;BR /&gt;/&lt;BR /&gt;sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;}NetSales )),'###.#0%')&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Below is a screen shot of what it is doing.&amp;nbsp; &amp;nbsp;Should I change the design to get both subtotals, if so how?&amp;nbsp; Or is there another solution?&amp;nbsp; Any help is appreciated.&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lfholland_0-1603115632000.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/42589i60327D867F7852DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lfholland_0-1603115632000.png" alt="lfholland_0-1603115632000.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>lfholland</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Pivot Table Sub totals</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Sub-totals/m-p/1753779#M718744</link>
      <description>&lt;P&gt;I have a pivot table I have created.&amp;nbsp; The requirement is to have Net Sales/Margin down the side and broken up by months across the top with YTD last year, YTD this year and Variance at the end.&amp;nbsp; No problems with that.&amp;nbsp; This issue is getting a subtotal.&amp;nbsp; It will only display the subtotal for the Net Margin % and not both Net Sales and Margin %.&lt;/P&gt;&lt;P&gt;My dimension for Net Sales/Margin % is the following:&lt;/P&gt;&lt;P&gt;=ValueList('Net Sales','Net Margin %')&lt;/P&gt;&lt;P&gt;I have three other dimensions along the left-hand side that are just the dimensions selected, not calculated dimensions.&lt;/P&gt;&lt;P&gt;My expression for one of the months is the following:&lt;/P&gt;&lt;P&gt;If(ValueList('Net Sales','Net Margin %')='Net Sales',&lt;/P&gt;&lt;P&gt;Num(sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;}NetSales ),'$###,###,##0'),&lt;/P&gt;&lt;P&gt;Num((sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;}NetMargin )&lt;BR /&gt;/&lt;BR /&gt;sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;}NetSales )),'###.#0%')&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Below is a screen shot of what it is doing.&amp;nbsp; &amp;nbsp;Should I change the design to get both subtotals, if so how?&amp;nbsp; Or is there another solution?&amp;nbsp; Any help is appreciated.&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lfholland_0-1603115632000.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/42589i60327D867F7852DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lfholland_0-1603115632000.png" alt="lfholland_0-1603115632000.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Sub-totals/m-p/1753779#M718744</guid>
      <dc:creator>lfholland</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Sub totals</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Sub-totals/m-p/1753807#M718745</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;1) Add to PlanGroup dimension real 'Total' text value.&lt;/P&gt;&lt;P&gt;2) Use additional condition for measures. First condition is for 'Total' dimension value with&amp;nbsp;&lt;STRONG&gt;TOTAL&amp;lt;PlanGroup &amp;gt; &lt;/STRONG&gt;addition, and orignal measure expression for another values:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF(PlanGroup='Total',&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If(ValueList('Net Sales','Net Margin %')='Net Sales',&lt;/P&gt;&lt;P&gt;Num(sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;} &lt;STRONG&gt;TOTAL&amp;lt;PlanGroup &amp;gt;&lt;/STRONG&gt; NetSales ),'$###,###,##0'),&lt;/P&gt;&lt;P&gt;Num((sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;}&lt;STRONG&gt;TOTAL&amp;lt;PlanGroup &amp;gt;&lt;/STRONG&gt; NetMargin )&lt;BR /&gt;/&lt;BR /&gt;sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;} &lt;STRONG&gt;TOTAL&amp;lt;PlanGroup &amp;gt;&amp;nbsp;&lt;/STRONG&gt;NetSales )),'###.#0%')&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;,&amp;nbsp; //ELSE&lt;/P&gt;&lt;P&gt;If(ValueList('Net Sales','Net Margin %')='Net Sales',&lt;/P&gt;&lt;P&gt;Num(sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;}NetSales ),'$###,###,##0'),&lt;/P&gt;&lt;P&gt;Num((sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;}NetMargin )&lt;BR /&gt;/&lt;BR /&gt;sum({$&amp;lt;Year={"&amp;lt;=$(=Max(Year))"},MonthName={"&amp;gt;=$(=addmonths(today(), -8)) &amp;lt;=$(=addmonths(today(), -7))"},Month=&amp;gt;}NetSales )),'###.#0%')&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;)&lt;BR /&gt;&lt;BR /&gt;Also for better performance and readabilty, you can replace valuelist with real island table dimension&lt;/P&gt;&lt;P&gt;Load * inline&lt;/P&gt;&lt;P&gt;[Measures&lt;/P&gt;&lt;P&gt;'Net Sales'&lt;/P&gt;&lt;P&gt;'Net Margin %'];&lt;/P&gt;&lt;P&gt;and replace &lt;EM&gt;If(ValueList('Net Sales','Net Margin %')='Net Sales'&amp;nbsp;, expr1, expr2)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;with&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pick(Match(Measures, &lt;EM&gt;'Net Sales', 'Net Margin %'),&amp;nbsp;&lt;/EM&gt;expr1, expr2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 15:21:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Sub-totals/m-p/1753807#M718745</guid>
      <dc:creator>Zhandos_Shotan</dc:creator>
      <dc:date>2020-10-19T15:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Sub totals</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Sub-totals/m-p/1753834#M718746</link>
      <description>&lt;P&gt;How do I "&lt;SPAN&gt;1) Add to PlanGroup dimension real 'Total' text value." ? Once I figure that out, I think this solution will work! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 17:06:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Sub-totals/m-p/1753834#M718746</guid>
      <dc:creator>lfholland</dc:creator>
      <dc:date>2020-10-19T17:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Sub totals</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Sub-totals/m-p/1753860#M718747</link>
      <description>&lt;P&gt;Adding dummy row to table with PlanGroup dimension at script. Something like:&lt;/P&gt;&lt;P&gt;Concatenate load&lt;/P&gt;&lt;P&gt;'Total' as PlanGroup,&lt;/P&gt;&lt;P&gt;0 as Fieldname1&lt;/P&gt;&lt;P&gt;0 as Fieldname2&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;its depends on your data model.&lt;/P&gt;&lt;P&gt;OR,&lt;/P&gt;&lt;P&gt;you can preagregate values and join Total row to table:&amp;nbsp; ..Sum(NetSales) ... group by PlanGroup..&lt;/P&gt;&lt;P&gt;But exclude Total row with measures when its unnesesary: &amp;lt;PlanGroup -={'Total'}&amp;gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 18:40:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Sub-totals/m-p/1753860#M718747</guid>
      <dc:creator>Zhandos_Shotan</dc:creator>
      <dc:date>2020-10-19T18:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Sub totals</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Sub-totals/m-p/1753876#M718748</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 19:45:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Sub-totals/m-p/1753876#M718748</guid>
      <dc:creator>lfholland</dc:creator>
      <dc:date>2020-10-19T19:45:21Z</dc:date>
    </item>
  </channel>
</rss>

