<?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: Get field value in color expression statement in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/1523285#M37544</link>
    <description>&lt;P&gt;There is unfortunately,&amp;nbsp; no "this" or "self" construct. I wish there were.&amp;nbsp; So you effectively have to name the column either by name or number to reference it's value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;</description>
    <pubDate>Fri, 21 Dec 2018 00:24:00 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2018-12-21T00:24:00Z</dc:date>
    <item>
      <title>Get field value in color expression statement</title>
      <link>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/1523213#M37536</link>
      <description>&lt;P&gt;Let's say I am developing a sheet and on that sheet I am using a table visualization. In this table, I add a calculated field, let's say it's a calculated measure. I enter my expression and I see my measure being calculated accordingly. That's all fine.&lt;/P&gt;&lt;P&gt;Now, for an example I want to be able to color code the field based on its value. The only way I know how to do this is to put the exact same formula in the color expression statement, surrounded by some IFs. This totally works, but it has a few problems:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If I have a 3 way conditional (or otherwise need to reference the calculated value in more than one spot), then I have to insert the entire field expression (and it can get long)&amp;nbsp;&lt;EM&gt;each time&amp;nbsp;&lt;/EM&gt;that I need it&lt;/LI&gt;&lt;LI&gt;I have two places to update now - if I need to modify the set analysis of the field calculation, I have to now modify the corresponding set analysis of the color calculation&lt;/LI&gt;&lt;LI&gt;It's not very scalable - if I want multiple fields to have their color code based on the same criteria, then if I ever want to extend that color coding criteria to other calculated fields, or if I need to consistently modify the criteria across multiple fields, it is not a matter of cut and paste on that field, but I have to modify around the calculation&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is there a way that I can just reference the calculated field's value in the color expression? Something like:&lt;/P&gt;&lt;PRE&gt;=if($value &amp;gt; 0, green(), if($value &amp;lt; 0, red(), black())&lt;/PRE&gt;&lt;P&gt;And to be clear, this would be helpful for more than just the foreground color. It would also be useful for the background color and the URL link text for items that I display as URLs.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:59:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/1523213#M37536</guid>
      <dc:creator>mplautz</dc:creator>
      <dc:date>2024-11-16T06:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get field value in color expression statement</title>
      <link>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/1523219#M37537</link>
      <description>&lt;P&gt;Have you seen the Column() function? I think this might be what you are looking for -&amp;gt;&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/November2018/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/InterRecordFunctions/column.htm" target="_blank"&gt;Column&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 19:05:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/1523219#M37537</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-20T19:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get field value in color expression statement</title>
      <link>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/1523239#M37538</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;, yes, this Column() function is significantly more scalable and solves most of the problems that I listed in my three bullet points of my original post. A few comments though:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The Column() function only works on measures. What I described in my original post was a measure, however, I have run into scenarios where it would be helpful to do the same operation on dimensions, since I often also have calculated dimensions too&lt;/LI&gt;&lt;LI&gt;The Column() function takes a single argument, which requires me to know the order of my measures. Of course, this should never be too big of an issue since I am always the author of the entire table, but if I reorder the columns, and two measures switch order priority, then I now have to update the argument in the Column() function&lt;/LI&gt;&lt;LI&gt;Because the Column() function requires a single argument, I still can't copy and paste a color formula between multiple fields like I could if there were just a $value construct that I could leverage&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;With all of this in mind, is there also a function that you know of that addresses some of the challenges I listed above? (If not, the Column() function gets me 65% of the way there.)&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 19:50:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/1523239#M37538</guid>
      <dc:creator>mplautz</dc:creator>
      <dc:date>2018-12-20T19:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get field value in color expression statement</title>
      <link>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/1523246#M37539</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/57851"&gt;@mplautz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;The Column() function only works on measures. What I described in my original post was a measure, however, I have run into scenarios where it would be helpful to do the same operation on dimensions, since I often also have calculated dimensions too&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;May be use GetObjectField for this one&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/November2018/Subsystems/Hub/Content/Sense_Hub/Scripting/SystemFunctions/GetObjectField.htm" target="_blank"&gt;GetObjectField&lt;/A&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/57851"&gt;@mplautz&lt;/a&gt;&amp;nbsp;wrote:&lt;UL&gt;&lt;LI&gt;The Column() function takes a single argument, which requires me to know the order of my measures. Of course, this should never be too big of an issue since I am always the author of the entire table, but if I reorder the columns, and two measures switch order priority, then I now have to update the argument in the Column() function&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You can address this by using Expression label instead of Column() function. So if you expression is labeled XYZ... you can use [XYZ] as the column reference&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/57851"&gt;@mplautz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;Because the Column() function requires a single argument, I still can't copy and paste a color formula between multiple fields like I could if there were just a $value construct that I could leverage&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I am not sure if this is possible... some level of human intervention will be needed. I guess if QlikView or Qlik Sense were to be able to do everything for us, then why would they need developers like us :). Jokes apart, I am not sure if this is possible, but may be&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6148"&gt;@rwunderlich&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;might have an idea for this.&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Sunny&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 20:27:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/1523246#M37539</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-20T20:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get field value in color expression statement</title>
      <link>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/1523285#M37544</link>
      <description>&lt;P&gt;There is unfortunately,&amp;nbsp; no "this" or "self" construct. I wish there were.&amp;nbsp; So you effectively have to name the column either by name or number to reference it's value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 00:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/1523285#M37544</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2018-12-21T00:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get field value in color expression statement</title>
      <link>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/2488453#M101673</link>
      <description>&lt;P&gt;Thanks for clarification.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 14:12:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-field-value-in-color-expression-statement/m-p/2488453#M101673</guid>
      <dc:creator>gerhard_jakubec</dc:creator>
      <dc:date>2024-10-22T14:12:36Z</dc:date>
    </item>
  </channel>
</rss>

