<?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: how to define color with a expression while the dimension is master dimension in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/how-to-define-color-with-a-expression-while-the-dimension-is/m-p/1805428#M65467</link>
    <description>&lt;P&gt;With Master Dimensions you don't need an expression. You can set the colors for each value of the Dimension individually and they will carry over to every chart you use them in if you wish. Simply Edit the Dimension and choose Value Colors like below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dalton_Ruer_0-1620218791039.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/54339i1FEF52BA4FCFD0A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dalton_Ruer_0-1620218791039.png" alt="Dalton_Ruer_0-1620218791039.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 May 2021 12:46:53 GMT</pubDate>
    <dc:creator>Dalton_Ruer</dc:creator>
    <dc:date>2021-05-05T12:46:53Z</dc:date>
    <item>
      <title>how to define color with a expression while the dimension is master dimension</title>
      <link>https://community.qlik.com/t5/App-Development/how-to-define-color-with-a-expression-while-the-dimension-is/m-p/1804767#M65388</link>
      <description>&lt;P&gt;I would like to make colors consistent by value. Furthermore, I would like to define a map between values and colors once and use it with a function. So, I came with the idea that I will create a variable like &lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Using-user-defined-function-in-expression/td-p/870973" target="_self"&gt;this&lt;/A&gt; and use it in expression to define colors.&lt;/P&gt;&lt;P&gt;My variable would be like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;set color = if($1=2022,'#1e90ff',&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if($1=2021 ,'#9400d3',&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if($1=2020 ,'#b22222',&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if($1=2019 ,'#228b22',&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if($1=2018 ,'#4682b4','#000000')))))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and I will put this in expression for color:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$(color(my_dim))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;But there is a problem. I can't use it with master dimension &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the definition of master dimension, it's not possible to define the color with an expression.&lt;/P&gt;&lt;P&gt;On the other hand in the expression for color, it's not possible to use the dimension value easily like $1, we should put the dimension value there.&amp;nbsp; So, if I put the expression of master dimension inside the color expression it would be something like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$(color(if(dim_1=$(another_var),'Y','N')))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;which means two expressions inside each other and it doesn't work.&lt;/P&gt;&lt;P&gt;Does anyone have a solution for my problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 21:49:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/how-to-define-color-with-a-expression-while-the-dimension-is/m-p/1804767#M65388</guid>
      <dc:creator>parviz_asoodehfard</dc:creator>
      <dc:date>2021-05-03T21:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to define color with a expression while the dimension is master dimension</title>
      <link>https://community.qlik.com/t5/App-Development/how-to-define-color-with-a-expression-while-the-dimension-is/m-p/1805428#M65467</link>
      <description>&lt;P&gt;With Master Dimensions you don't need an expression. You can set the colors for each value of the Dimension individually and they will carry over to every chart you use them in if you wish. Simply Edit the Dimension and choose Value Colors like below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dalton_Ruer_0-1620218791039.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/54339i1FEF52BA4FCFD0A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dalton_Ruer_0-1620218791039.png" alt="Dalton_Ruer_0-1620218791039.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 12:46:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/how-to-define-color-with-a-expression-while-the-dimension-is/m-p/1805428#M65467</guid>
      <dc:creator>Dalton_Ruer</dc:creator>
      <dc:date>2021-05-05T12:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to define color with a expression while the dimension is master dimension</title>
      <link>https://community.qlik.com/t5/App-Development/how-to-define-color-with-a-expression-while-the-dimension-is/m-p/1805439#M65471</link>
      <description>&lt;P&gt;It's just appropriate for a situation you don't want to change color for a lot of dimensions.&amp;nbsp; One of the dimensions which I would like to change is the Year that exists in lots of apps. I would like to have consistent color in all apps in this way I should add color code for 20 different years in different apps. but with the solution I have in my mind, I can just add an expression like 'color(year)' into the master item.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 13:09:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/how-to-define-color-with-a-expression-while-the-dimension-is/m-p/1805439#M65471</guid>
      <dc:creator>parviz_asoodehfard</dc:creator>
      <dc:date>2021-05-05T13:09:17Z</dc:date>
    </item>
  </channel>
</rss>

