<?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: Calculation across rows in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648385#M237331</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Ruben, for providing some options.&lt;/P&gt;&lt;P&gt;I'll probably end up adding the data column to the script and use that in my calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Oct 2014 13:17:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-02T13:17:26Z</dc:date>
    <item>
      <title>Calculation across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648378#M237324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I'm looking to a better way to implement the calculation below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need to calculate is the value in the last columns below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Dimension 1&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Dimension 2&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Value&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;% of A&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;X&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;X&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;X&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;30&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;30%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Y&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Y&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;25%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Y&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;40&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last column show the % of the value in the specific row compared to the value where dimension 2 is equal to 'A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having issue calculating the denominator of my formula that should always be equal to the value measure when dimension 2 is&amp;nbsp; equal to A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I specify the denominator through Set Analysis as&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SUM({&amp;lt;[Dimension 2]&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;={'Gross Sales'}&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;gt;} Value)&lt;/STRONG&gt; I got the below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Dimension 1&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Dimension 2&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Value&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Denominator&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;X&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;X&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;X&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;30&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Y&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Y&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Y&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;40&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;While I need to have 100 and 200 repeated on all rows.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;If I use Total as &lt;STRONG&gt;SUM({Total&amp;lt;[Dimension 2]&lt;SPAN style="font-size: 10pt;"&gt;={'Gross Sales'}&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;gt;} Value)&lt;/STRONG&gt; I got the below&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;Dimension 1&lt;/TH&gt;&lt;TH style="text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;Dimension 2&lt;/TH&gt;&lt;TH style="text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;Value&lt;/TH&gt;&lt;TH style="text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;Denominator&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;300&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;That is again wrong as&amp;nbsp; the total is done ignoring all dimension grouping.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I got it to work specifying the group by dimension for the total as follow &lt;STRONG&gt;SUM({&amp;lt;[Dimension 2]&lt;SPAN style="font-size: 10pt;"&gt;={'Gross Sales'}&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;gt;} Total&amp;lt;[Dimension 1] Value)&lt;/STRONG&gt; but i would&amp;nbsp; like to know if:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;- There's any better way to express this as right now in my total I need to list all the dimensions excluding the one on which I'm applying the filter (Dimension 2 in the example)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;- In case of many dimensions to group on and high volume of data there may be performance implications&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Andrea&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 09:13:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648378#M237324</guid>
      <dc:creator />
      <dc:date>2014-10-02T09:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648379#M237325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post app ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 09:19:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648379#M237325</guid>
      <dc:creator>annafuksa1</dc:creator>
      <dc:date>2014-10-02T09:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648380#M237326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrea, I attach an example using above function, It will get the first row based on the last dimension, so if there is a Dimension after 'Dimension 2' probably won't meet your requirements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 10:10:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648380#M237326</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2014-10-02T10:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Calculation across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648381#M237327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but I fear is not going to work for more complex scenarios.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a small example but I'm not sure how I can upload it here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Andrea ! !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 10:32:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648381#M237327</guid>
      <dc:creator />
      <dc:date>2014-10-02T10:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Calculation across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648382#M237328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you're&amp;nbsp; answering, in the upper-right corner there is a link to advanzed editor:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="68162" alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/68162_pastedImage_0.png" style="width: 620px; height: 243px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the you can upload files:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="68163" alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/68163_pastedImage_0.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 10:36:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648382#M237328</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2014-10-02T10:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648383#M237329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Attached I created a small example.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In short I want to understand if there's a better way to calculate the denominator than the one I used in the "Denominator - Total Group By" expression as I don't like the idea of listing all my dimensions into the Total function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 10:45:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648383#M237329</guid>
      <dc:creator />
      <dc:date>2014-10-02T10:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Calculation across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648384#M237330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrea, different approaches:&lt;/P&gt;&lt;P&gt;- the above function i told you before&lt;/P&gt;&lt;P&gt;- modification in script so there is the TOTAL value in each record&lt;/P&gt;&lt;P&gt;- using a variable to list the dimensions, playing with the value the variable should return you can work to make this more dynamic. (using concat if there is a field where user selects dimensions)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope any of this helps you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 11:00:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648384#M237330</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2014-10-02T11:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648385#M237331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Ruben, for providing some options.&lt;/P&gt;&lt;P&gt;I'll probably end up adding the data column to the script and use that in my calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 13:17:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-across-rows/m-p/648385#M237331</guid>
      <dc:creator />
      <dc:date>2014-10-02T13:17:26Z</dc:date>
    </item>
  </channel>
</rss>

