<?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: Alternating colours based on multiple different groups in a table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Alternating-colours-based-on-multiple-different-groups-in-a/m-p/2007091#M1221573</link>
    <description>&lt;P&gt;thank you so much for this! I use Qlik Sense too &amp;amp; will give it a go.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have probably over 20,000 distinct values in that column, so the flag method is something I was looking for, thank you!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2022 14:31:36 GMT</pubDate>
    <dc:creator>daniela_zuza</dc:creator>
    <dc:date>2022-11-21T14:31:36Z</dc:date>
    <item>
      <title>Alternating colours based on multiple different groups in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Alternating-colours-based-on-multiple-different-groups-in-a/m-p/2005375#M1221521</link>
      <description>&lt;P&gt;Hello, I am using Qlik Sense actually, but I need to colour the background of cells in a table based on the different grouped values. It's easier to show this on the example below, which I achieved in excel by adding another column which alternates from 0 to 1 when the grouping changes, and then applying the colour based on that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this the same way to proceed in Qlik, or is there a direct way to do it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="daniela_zuza_0-1668610402098.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/93884i9E8308122CCE131D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="daniela_zuza_0-1668610402098.png" alt="daniela_zuza_0-1668610402098.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have too many groups to be able to use an IF clause alongside specifying each one.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 14:54:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternating-colours-based-on-multiple-different-groups-in-a/m-p/2005375#M1221521</guid>
      <dc:creator>daniela_zuza</dc:creator>
      <dc:date>2022-11-16T14:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Alternating colours based on multiple different groups in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Alternating-colours-based-on-multiple-different-groups-in-a/m-p/2005453#M1221524</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if the column's value contain only a few values and you know what they are , pick(match(column,'first','second'...),RGB(),RGB(),RGB())&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;this will return the color if the values match. first , second etc. apply this to the column's background expression.&lt;/P&gt;
&lt;P&gt;if your data grows and the column changes&amp;nbsp; or new values added etc. and you want to just alternate between 2 color for group:&lt;BR /&gt;&lt;BR /&gt;load your table in sorted sequence that you would like to see on the table chart (in this case column is the field name)&lt;/P&gt;
&lt;P&gt;then use your table in another load statement only loading the distinct value of your grouping, assign an id using recno() as a preceding load, which you will use to load your distinct table using mod(id,2) as flag&lt;/P&gt;
&lt;P&gt;this will result in a distinct group name, and a 0,1 flag, then you join it back to your primary table.&lt;/P&gt;
&lt;P&gt;here's the sample :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;//this is your primary table, because qlik aggregate the same dimensional values on chart display i added rowid to this table &lt;BR /&gt;t:NoConcatenate&lt;BR /&gt;load *&lt;BR /&gt;,recno() as rowid;&lt;BR /&gt;load * inline&lt;BR /&gt;[Column1&lt;BR /&gt;AAA&lt;BR /&gt;AAA&lt;BR /&gt;AAA&lt;BR /&gt;EEE&lt;BR /&gt;EEE&lt;BR /&gt;AAA&lt;BR /&gt;BBB&lt;BR /&gt;BBB&lt;BR /&gt;CCC&lt;BR /&gt;AAA&lt;BR /&gt;AAA&lt;BR /&gt;CCC&lt;BR /&gt;CCC&lt;BR /&gt;DDD&lt;BR /&gt;BBB&lt;BR /&gt;BBB&lt;BR /&gt;DDD&lt;BR /&gt;DDD&lt;BR /&gt;EEE&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;//create a distinct table with values of the grouping field&lt;BR /&gt;idxtable:NoConcatenate&lt;BR /&gt;load distinct Column1 &lt;BR /&gt;resident t;&lt;/P&gt;
&lt;P&gt;//load them into another table adding recno() as an id for each grouping field value, sort it in teh preceding load&lt;BR /&gt;//then use that for mod(id,2) to return either 0 or 1 as flag&lt;BR /&gt;tmp2:NoConcatenate&lt;BR /&gt;load * ,&lt;BR /&gt;mod(id,2) as flag;&lt;BR /&gt;load Column1&lt;BR /&gt;,RecNo() as id&lt;BR /&gt;resident idxtable&lt;BR /&gt;order by Column1;&lt;/P&gt;
&lt;P&gt;drop table idxtable;&lt;/P&gt;
&lt;P&gt;//drop the table and join the flag field back into your main table.&lt;BR /&gt;inner join ('t')&lt;BR /&gt;load Column1,&lt;BR /&gt;flag&lt;BR /&gt;resident tmp2;&lt;BR /&gt;&lt;BR /&gt;drop table tmp2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result is a table (t) with Column1, rowid, flag&lt;/P&gt;
&lt;P&gt;where flag will be either 1 or 0&lt;/P&gt;
&lt;P&gt;if you sort your chart using the same column they should all group as 1 or 0&lt;/P&gt;
&lt;P&gt;then in each column just add the if(flag=0,rgb(),rgb()) should alternate the coloring for the group&lt;/P&gt;
&lt;P&gt;EDIT: This is for qlik Sense, i dont use qlik view but i am sure the load should work&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 16:30:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternating-colours-based-on-multiple-different-groups-in-a/m-p/2005453#M1221524</guid>
      <dc:creator>hoangvvo</dc:creator>
      <dc:date>2022-11-16T16:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Alternating colours based on multiple different groups in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Alternating-colours-based-on-multiple-different-groups-in-a/m-p/2007091#M1221573</link>
      <description>&lt;P&gt;thank you so much for this! I use Qlik Sense too &amp;amp; will give it a go.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have probably over 20,000 distinct values in that column, so the flag method is something I was looking for, thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 14:31:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternating-colours-based-on-multiple-different-groups-in-a/m-p/2007091#M1221573</guid>
      <dc:creator>daniela_zuza</dc:creator>
      <dc:date>2022-11-21T14:31:36Z</dc:date>
    </item>
  </channel>
</rss>

