<?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: Re: Pivot table show/hide subtotal by macro. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599629#M221965</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this case partial sums will be showed on selections of a certain field and checked and set in loop - for further information look in APIGuide.qvw in your install-folder. If you handled with bigger objects and large amounts of data it could be rather slow and it won't work on AJAX - so the tip from &lt;A href="https://community.qlik.com/qlik-users/96544"&gt;Gysbert Wassenaar&lt;/A&gt; could be better suit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14087196846584884" jivemacro_uid="_14087196846584884"&gt;
&lt;P&gt;sub PartialSums&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;dim chart, prop, dims, pSums, str, i, j 'Variablen deklarieren&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;set doc = ActiveDocument&lt;/P&gt;
&lt;P&gt;set pSums&amp;nbsp; = doc.Fields("_PartialSums").getSelectedValues 'selektierte Werte vom Auswahlfeld in ein Array einlesen&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;set chart = doc.GetSheetObject("CH01") 'Pivot auswählen&lt;/P&gt;
&lt;P&gt;prop = chart.GetProperties 'Zugriff auf Eigenschaften&lt;/P&gt;
&lt;P&gt;set dims = prop.Dimensions 'Auswahl der Dimensionseigenschaften&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;for i = 0 to dims.Count - 1 'Pivotdimensionen durchlaufen und auslesen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dims(i).ShowPartialSums = false 'für alle Dimensionen die Teilergebnisse rausnehmen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for j = 0 to pSums.Count - 1 'selektierte Werte des Auswahlfeldes werden durchlaufen und ausgelsen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if dims.Item(i).Title.v = pSums.Item(j).Text then dims(i).ShowPartialSums = true 'Vergleich des Auslesens + setzen des Teilergbenis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; next&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'str = str &amp;amp; dims.Item(i).Label.v &amp;amp; chr(10)&lt;/P&gt;
&lt;P&gt;next&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;chart.SetProperties prop 'Zuweisung der Sichtbarkeiten für die Teilergebnisse für die Dimensionseigenschaften der Pivot&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;set doc = nothing 'Variablen löschen&lt;/P&gt;
&lt;P&gt;set pSums = nothing&lt;/P&gt;
&lt;P&gt;set chart = nothing&lt;/P&gt;
&lt;P&gt;set dims = nothing&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;end sub&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Aug 2014 15:09:51 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2014-08-22T15:09:51Z</dc:date>
    <item>
      <title>Pivot table show/hide subtotal by macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599625#M221961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any way to create a macro that allows to hide/show dimension subtotals in a pivot table?&lt;/P&gt;&lt;P&gt;I found:&lt;/P&gt;&lt;P&gt;- Tricks to do that for example using twin dimensions, one with total and other without and showing both alternatively, &lt;/P&gt;&lt;P&gt;- In an straight table &lt;A href="https://community.qlik.com/message/388000"&gt;Qlikview show totals for dimensions in straight table activate per macro&lt;/A&gt; (I look for a macro similar to this one ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;&lt;P&gt;Juan C.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Feb 2014 11:38:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599625#M221961</guid>
      <dc:creator>juan_c_martinez</dc:creator>
      <dc:date>2014-02-03T11:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot table show/hide subtotal by macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599626#M221962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;If you're using QV11 it's easier to add the dimension twice, once with partial sums enabled and once without, and use the conditional display expression to toggle between the two. See attached example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Feb 2014 11:54:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599626#M221962</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-02-03T11:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot table show/hide subtotal by macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599627#M221963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gysbert, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already knew this trick and I have used it (see my post) but the problem is when the user change the sequence or pivot the dimension, the dimension hidden remain&amp;nbsp; in the place last time is was shown . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any case thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Juan C. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Feb 2014 14:04:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599627#M221963</guid>
      <dc:creator>juan_c_martinez</dc:creator>
      <dc:date>2014-02-03T14:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot table show/hide subtotal by macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599628#M221964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Juan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could predefine the dimensions used on your pivot table using data islands and afterwards use &lt;A href="https://community.qlik.com/qlik-users/96544"&gt;Gysbert Wassenaar&lt;/A&gt; solution (the order problem is solved...).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 12:54:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599628#M221964</guid>
      <dc:creator />
      <dc:date>2014-08-22T12:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Pivot table show/hide subtotal by macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599629#M221965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this case partial sums will be showed on selections of a certain field and checked and set in loop - for further information look in APIGuide.qvw in your install-folder. If you handled with bigger objects and large amounts of data it could be rather slow and it won't work on AJAX - so the tip from &lt;A href="https://community.qlik.com/qlik-users/96544"&gt;Gysbert Wassenaar&lt;/A&gt; could be better suit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14087196846584884" jivemacro_uid="_14087196846584884"&gt;
&lt;P&gt;sub PartialSums&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;dim chart, prop, dims, pSums, str, i, j 'Variablen deklarieren&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;set doc = ActiveDocument&lt;/P&gt;
&lt;P&gt;set pSums&amp;nbsp; = doc.Fields("_PartialSums").getSelectedValues 'selektierte Werte vom Auswahlfeld in ein Array einlesen&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;set chart = doc.GetSheetObject("CH01") 'Pivot auswählen&lt;/P&gt;
&lt;P&gt;prop = chart.GetProperties 'Zugriff auf Eigenschaften&lt;/P&gt;
&lt;P&gt;set dims = prop.Dimensions 'Auswahl der Dimensionseigenschaften&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;for i = 0 to dims.Count - 1 'Pivotdimensionen durchlaufen und auslesen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dims(i).ShowPartialSums = false 'für alle Dimensionen die Teilergebnisse rausnehmen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for j = 0 to pSums.Count - 1 'selektierte Werte des Auswahlfeldes werden durchlaufen und ausgelsen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if dims.Item(i).Title.v = pSums.Item(j).Text then dims(i).ShowPartialSums = true 'Vergleich des Auslesens + setzen des Teilergbenis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; next&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'str = str &amp;amp; dims.Item(i).Label.v &amp;amp; chr(10)&lt;/P&gt;
&lt;P&gt;next&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;chart.SetProperties prop 'Zuweisung der Sichtbarkeiten für die Teilergebnisse für die Dimensionseigenschaften der Pivot&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;set doc = nothing 'Variablen löschen&lt;/P&gt;
&lt;P&gt;set pSums = nothing&lt;/P&gt;
&lt;P&gt;set chart = nothing&lt;/P&gt;
&lt;P&gt;set dims = nothing&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;end sub&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 15:09:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599629#M221965</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-08-22T15:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Pivot table show/hide subtotal by macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599630#M221966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Marcus!!&amp;nbsp; I have added a document with a sample showing how your macro works .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really grateful for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Juan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 07:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-show-hide-subtotal-by-macro/m-p/599630#M221966</guid>
      <dc:creator>juan_c_martinez</dc:creator>
      <dc:date>2014-08-28T07:47:55Z</dc:date>
    </item>
  </channel>
</rss>

