<?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 loop through field on a document level in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/loop-through-field-on-a-document-level/m-p/244316#M93209</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would use advanced aggregation (Aggr) for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Sum(Aggr(Sum(Actual)&amp;lt;Sum(Budget),Region))=0,green(),red())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It goes like this:&lt;/P&gt;&lt;P&gt;1/ Sum(Actual)&amp;lt;Sum(Budget) gets aggregated and calculated over dimension Region&lt;/P&gt;&lt;P&gt;2/ The resulting list of values (which would be either true of false because of the comparision) is summed up&lt;/P&gt;&lt;P&gt;3/ If all the results were false (Sum(Actual) was always over Sum(Budget)), the result of the outer Sum will be 0. If any of them was not false, it will be something else.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Feb 2012 15:42:04 GMT</pubDate>
    <dc:creator>kuba_michalik</dc:creator>
    <dc:date>2012-02-01T15:42:04Z</dc:date>
    <item>
      <title>loop through field on a document level</title>
      <link>https://community.qlik.com/t5/QlikView/loop-through-field-on-a-document-level/m-p/244315#M93208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; &lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Hello. I wonder if it’s possible in QV to loop through the field on a document level (not in the script), sort of copy the functionality of banding from report editor. I’m not sure if that’s even the best approach for solving my problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Here’s what I need to accomplish.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;For example, I have 4 regions; let’s call those regions A, B, C and D. Those regions have actual and budget data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Let’s say that now I have a text object, and this text object has calculated background color condition. In this condition, I need to compare each region’s actual to a budget, and &lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;if actual is greater than budget in &lt;SPAN style="text-decoration: underline;"&gt;all &lt;/SPAN&gt;of those regions, then color it green, if actual is less that budget in at least &lt;SPAN style="text-decoration: underline;"&gt;one &lt;/SPAN&gt;of those regions, then color it red. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Rough logic would look like so:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;If(sum({&amp;lt;Region={'A'}&amp;gt;}Actual)&amp;gt;sum({&amp;lt;Region={'A'}&amp;gt;}Budget) or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;sum({&amp;lt;Region={'B'}&amp;gt;}Actual)&amp;gt;sum({&amp;lt;Region={'B'}&amp;gt;}Budget) or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;sum({&amp;lt;Region={'C'}&amp;gt;}Actual)&amp;gt;sum({&amp;lt;Region={'C'}&amp;gt;}Budget) or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;sum({&amp;lt;Region={'D'}&amp;gt;}Actual)&amp;gt;sum({&amp;lt;Region={'D'}&amp;gt;}Budget), green(), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;if(…&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;My concern is that I can’t hard code Region values in set analysis because they are dynamic. Also, there are a lot Regions, so it’s not really feasible solution either. To make things harder, I can’t use script to do this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Any suggestions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 15:33:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/loop-through-field-on-a-document-level/m-p/244315#M93208</guid>
      <dc:creator />
      <dc:date>2012-02-01T15:33:57Z</dc:date>
    </item>
    <item>
      <title>loop through field on a document level</title>
      <link>https://community.qlik.com/t5/QlikView/loop-through-field-on-a-document-level/m-p/244316#M93209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would use advanced aggregation (Aggr) for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Sum(Aggr(Sum(Actual)&amp;lt;Sum(Budget),Region))=0,green(),red())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It goes like this:&lt;/P&gt;&lt;P&gt;1/ Sum(Actual)&amp;lt;Sum(Budget) gets aggregated and calculated over dimension Region&lt;/P&gt;&lt;P&gt;2/ The resulting list of values (which would be either true of false because of the comparision) is summed up&lt;/P&gt;&lt;P&gt;3/ If all the results were false (Sum(Actual) was always over Sum(Budget)), the result of the outer Sum will be 0. If any of them was not false, it will be something else.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 15:42:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/loop-through-field-on-a-document-level/m-p/244316#M93209</guid>
      <dc:creator>kuba_michalik</dc:creator>
      <dc:date>2012-02-01T15:42:04Z</dc:date>
    </item>
    <item>
      <title>loop through field on a document level</title>
      <link>https://community.qlik.com/t5/QlikView/loop-through-field-on-a-document-level/m-p/244317#M93210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Nice, it didn't even cross my mind to do it that way. My requirement for the coloring has more logic in it, but I think I should be able to to make that to work based off your example. If i get stuck I will post here again. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 20:11:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/loop-through-field-on-a-document-level/m-p/244317#M93210</guid>
      <dc:creator />
      <dc:date>2012-02-01T20:11:46Z</dc:date>
    </item>
  </channel>
</rss>

