<?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 Possible to get column number or dimension name reference in a straight table? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Possible-to-get-column-number-or-dimension-name-reference-in-a/m-p/2134607#M92196</link>
    <description>&lt;P&gt;I would like to be able to color or show/hide columns in a straight table based on the dimension name, so that I can have a single expression in the show/hide field that operates based on other mappings.&lt;/P&gt;
&lt;P&gt;I cannot seem to find a way to get a column/dimension value from within the table itself. Is this possible?&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;I have a simple straight table like this, with no calculated fields (that is, each column is a simple dimension with the field name as the label).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="awwitas_0-1699044971065.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/119338i8EEC07689661B74C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="awwitas_0-1699044971065.png" alt="awwitas_0-1699044971065.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In the 'Background color expression' dimension details, I'd like to be able to use an expression that is something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Pick(
    Match(	
    GetObjectDimension(ColumnNo())
    ,'ItemNM'
    ,'CountNBR'
    ,'ValueCD'
    ), red(), green(), blue())&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The expected result would be that using a single expression, the &amp;lt;ItemNM&amp;gt; column would be colored red, &amp;lt;CountNBR&amp;gt; would be blue, etc.&lt;BR /&gt;&lt;BR /&gt;The intended use would be having a single expression in a variable or similar that would color columns dynamically without me having to go in and change the field names in the dimension details every time I change or reorder the columns.&lt;BR /&gt;&lt;BR /&gt;I know that &lt;FONT face="courier new,courier"&gt;ColumnNo()&lt;/FONT&gt; does not work in a straight table... is there any other function or methodology for identifying what the dimension or column in a table is from within the show/hide or color expression details?&lt;/P&gt;</description>
    <pubDate>Fri, 03 Nov 2023 21:04:22 GMT</pubDate>
    <dc:creator>awwitas</dc:creator>
    <dc:date>2023-11-03T21:04:22Z</dc:date>
    <item>
      <title>Possible to get column number or dimension name reference in a straight table?</title>
      <link>https://community.qlik.com/t5/App-Development/Possible-to-get-column-number-or-dimension-name-reference-in-a/m-p/2134607#M92196</link>
      <description>&lt;P&gt;I would like to be able to color or show/hide columns in a straight table based on the dimension name, so that I can have a single expression in the show/hide field that operates based on other mappings.&lt;/P&gt;
&lt;P&gt;I cannot seem to find a way to get a column/dimension value from within the table itself. Is this possible?&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;I have a simple straight table like this, with no calculated fields (that is, each column is a simple dimension with the field name as the label).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="awwitas_0-1699044971065.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/119338i8EEC07689661B74C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="awwitas_0-1699044971065.png" alt="awwitas_0-1699044971065.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In the 'Background color expression' dimension details, I'd like to be able to use an expression that is something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Pick(
    Match(	
    GetObjectDimension(ColumnNo())
    ,'ItemNM'
    ,'CountNBR'
    ,'ValueCD'
    ), red(), green(), blue())&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The expected result would be that using a single expression, the &amp;lt;ItemNM&amp;gt; column would be colored red, &amp;lt;CountNBR&amp;gt; would be blue, etc.&lt;BR /&gt;&lt;BR /&gt;The intended use would be having a single expression in a variable or similar that would color columns dynamically without me having to go in and change the field names in the dimension details every time I change or reorder the columns.&lt;BR /&gt;&lt;BR /&gt;I know that &lt;FONT face="courier new,courier"&gt;ColumnNo()&lt;/FONT&gt; does not work in a straight table... is there any other function or methodology for identifying what the dimension or column in a table is from within the show/hide or color expression details?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 21:04:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Possible-to-get-column-number-or-dimension-name-reference-in-a/m-p/2134607#M92196</guid>
      <dc:creator>awwitas</dc:creator>
      <dc:date>2023-11-03T21:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to get column number or dimension name reference in a straight table?</title>
      <link>https://community.qlik.com/t5/App-Development/Possible-to-get-column-number-or-dimension-name-reference-in-a/m-p/2134613#M92197</link>
      <description>&lt;P&gt;I don't know of any way to dynamically do what you want using the same expression for every dim.&amp;nbsp; If your goal is to map the Dim names to color or other properties in a flexible way I can suggest an alternative.&amp;nbsp; Make a table like:&lt;/P&gt;
&lt;P&gt;DimName, DimColor&lt;BR /&gt;ItemNM, red()&lt;BR /&gt;CountNBR, green()&lt;BR /&gt;ValueCD, blue&lt;/P&gt;
&lt;P&gt;And then use a color expression like:&lt;/P&gt;
&lt;P&gt;=Only({&amp;lt;DimName={'ItemNM'}&amp;gt;}DimColor)&lt;/P&gt;
&lt;P&gt;You will have to hard code the name value for each Dimension, but it's a fairly simple pattern and it gives you the external mapping. This is the best I've been able to come up with in the past.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 23:16:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Possible-to-get-column-number-or-dimension-name-reference-in-a/m-p/2134613#M92197</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2023-11-03T23:16:02Z</dc:date>
    </item>
  </channel>
</rss>

