<?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: Alternative for a Loop in Chart Expressions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070195#M929295</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks Bill! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I have a variable like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let X = Count(distinct Team) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I put this into a for loop with a increment process. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Mar 2016 21:35:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-03-14T21:35:10Z</dc:date>
    <item>
      <title>Alternative for a Loop in Chart Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070193#M929293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to use a loop to define the colours of my bars in a chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm creating a bar chart that shows the number of goals of each football team, but my core is dynamic and I don't know how many teams I will receive (maybe 100...). What I'am thinking is create a expression in "Background Colour" from Expressions tab like this:&lt;BR /&gt;&lt;BR /&gt;While (var x &amp;lt;= "Number of Teams)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RGB(X + 10, Y + 10, Z + 10)&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that is not possible. Anyone have any better idea to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070193#M929293</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for a Loop in Chart Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070194#M929294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the load script you could create a dimension table for your teams and set a variable to contain the Count() of your distinct Teams.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then Left Join onto Team table from resident Team table and create you RGB using RecNo() and the Count value in your variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you have the rgb for each Team in your Team Table set your "Background Colour" to the team's rgb&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2016 19:34:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070194#M929294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-14T19:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for a Loop in Chart Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070195#M929295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks Bill! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I have a variable like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let X = Count(distinct Team) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I put this into a for loop with a increment process. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2016 21:35:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070195#M929295</guid>
      <dc:creator />
      <dc:date>2016-03-14T21:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for a Loop in Chart Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070196#M929296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can add a teamid (build with autonumber or recno or etc.....) to your script and use the colormix1 function (in background color expression, file , colormix wizard) to define the color&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/117971_1.png" style="height: 137px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2016 21:51:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070196#M929296</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2016-03-14T21:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for a Loop in Chart Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070197#M929297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe also possible as background color expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ColorMix1(RowNo()/NoOfRows(),LightBlue(),LightRed())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2016 23:00:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070197#M929297</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2016-03-14T23:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for a Loop in Chart Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070198#M929298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a nice option &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2016 10:21:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070198#M929298</guid>
      <dc:creator />
      <dc:date>2016-03-15T10:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for a Loop in Chart Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070199#M929299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bill can you post a example of the code (specially the part of the left join)?? Thanks &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2016 10:23:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070199#M929299</guid>
      <dc:creator />
      <dc:date>2016-03-15T10:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for a Loop in Chart Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070200#M929300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached &lt;SPAN style="font-size: 13.3333px;"&gt;sample &lt;/SPAN&gt;qvw and here is the script :&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;Teams :&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;LOAD * INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Team, Points&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Excellent Team, 10&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Good Team, 8&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OK Team, 5&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Iffy Team, 3&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could Try Harder, 1&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;CountTeams:&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;Load Count(distinct Team) as CountTeams &lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;resident Teams&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;Let vCountTeams = Peek('CountTeams')&amp;nbsp; ;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;Drop table CountTeams;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;Trace vCountTeams:&amp;nbsp; $(vCountTeams) ;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;Left Join ( Teams ) &lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp; ColorMix2(( ( (RecNo() -1) /&amp;nbsp; ( $(vCountTeams)&amp;nbsp; -1 )&amp;nbsp; ) * 2 ) -1 ,Green(),Red(),Yellow()) as TeamColorMix,&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp; *&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;resident Teams&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2016 10:39:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070200#M929300</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-15T10:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for a Loop in Chart Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070201#M929301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just Perfect Bill &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; Many thanks!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2016 10:48:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070201#M929301</guid>
      <dc:creator />
      <dc:date>2016-03-15T10:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for a Loop in Chart Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070202#M929302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you wanted to you could also in the script order the teams by the sum of their Points to rank them in order by how they are doing and put that into the &lt;EM&gt;ColorMix2()&lt;/EM&gt; so the leading teams are at the green end and the training teams at the red end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;One advantage of setting the colour in the script is that the colours are then fixed, but if done in the front end colours may change if selections mean not all the Teams are selected.&amp;nbsp; Also as a matter of principle I always try to put all calculations in the script when viable to do so.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2016 11:38:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-a-Loop-in-Chart-Expressions/m-p/1070202#M929302</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-15T11:38:19Z</dc:date>
    </item>
  </channel>
</rss>

