<?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 dynamic variables using dollar sign expansion in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/dynamic-variables-using-dollar-sign-expansion/m-p/1579128#M62979</link>
    <description>&lt;P&gt;In a straight table (or pivot table) with KPI as a dimension I define a measure having the function&amp;nbsp; ='vCurrent' &amp;amp; $(='$(vKPI)')&amp;nbsp; and have text returned in each cell as 'vCurrentID01', 'vCurrentID02', etc. for all KPIs.&lt;/P&gt;&lt;P&gt;The problem is that if I try to use the result as a variable by defining another measure having the function like =$(=$(='vCurrent' &amp;amp; $(='$(vKPI)')))&amp;nbsp; I'd hope to get the value of the associated variable.&lt;/P&gt;&lt;P&gt;It works fine when I'm filtered on one KPI, but blows up otherwise.&amp;nbsp; All vKPI is doing is Only(_KPI_ID)&lt;/P&gt;&lt;P&gt;I've successfully substituted out the vKPI variable in the function having $(=$(='vCurrent' &amp;amp; Only(_KPI_ID))) which again works fine when only a single KPI is filtered, but doesn't work fine otherwise.&lt;/P&gt;&lt;P&gt;I created a variable 'vCurrent' to confirm nulling out the dynamic part was the issue.&amp;nbsp; It baffles me why though the table can build a string but can't access a variable built from that string unless I filter to one KPI.&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;&lt;P&gt;At this point I'm fixated on "why doesn't this work!?!"&amp;nbsp; I have some alternate approaches to try out to solve the "real" problem in the app, but I'd really like to understand why this doesn't work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; (so at least for now, please no 'why are you trying to do this' questions, thanks!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Apr 2021 07:54:59 GMT</pubDate>
    <dc:creator>davetrentwipro</dc:creator>
    <dc:date>2021-04-02T07:54:59Z</dc:date>
    <item>
      <title>dynamic variables using dollar sign expansion</title>
      <link>https://community.qlik.com/t5/App-Development/dynamic-variables-using-dollar-sign-expansion/m-p/1579128#M62979</link>
      <description>&lt;P&gt;In a straight table (or pivot table) with KPI as a dimension I define a measure having the function&amp;nbsp; ='vCurrent' &amp;amp; $(='$(vKPI)')&amp;nbsp; and have text returned in each cell as 'vCurrentID01', 'vCurrentID02', etc. for all KPIs.&lt;/P&gt;&lt;P&gt;The problem is that if I try to use the result as a variable by defining another measure having the function like =$(=$(='vCurrent' &amp;amp; $(='$(vKPI)')))&amp;nbsp; I'd hope to get the value of the associated variable.&lt;/P&gt;&lt;P&gt;It works fine when I'm filtered on one KPI, but blows up otherwise.&amp;nbsp; All vKPI is doing is Only(_KPI_ID)&lt;/P&gt;&lt;P&gt;I've successfully substituted out the vKPI variable in the function having $(=$(='vCurrent' &amp;amp; Only(_KPI_ID))) which again works fine when only a single KPI is filtered, but doesn't work fine otherwise.&lt;/P&gt;&lt;P&gt;I created a variable 'vCurrent' to confirm nulling out the dynamic part was the issue.&amp;nbsp; It baffles me why though the table can build a string but can't access a variable built from that string unless I filter to one KPI.&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;&lt;P&gt;At this point I'm fixated on "why doesn't this work!?!"&amp;nbsp; I have some alternate approaches to try out to solve the "real" problem in the app, but I'd really like to understand why this doesn't work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; (so at least for now, please no 'why are you trying to do this' questions, thanks!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 07:54:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/dynamic-variables-using-dollar-sign-expansion/m-p/1579128#M62979</guid>
      <dc:creator>davetrentwipro</dc:creator>
      <dc:date>2021-04-02T07:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic variables using dollar sign expansion</title>
      <link>https://community.qlik.com/t5/App-Development/dynamic-variables-using-dollar-sign-expansion/m-p/1579447#M62980</link>
      <description>&lt;P&gt;Qlik doesn't evaluate any field- or variable-values as expressions - they are always plain strings. The only way to bypass it is the use of a $-sign expansion which creates an adhoc-variable which is always evaluated before the object is calculated (on a global level without regarding to the dimensions in the object) and this single result is applied to all rows.&lt;/P&gt;&lt;P&gt;This means your approach couldn't work. If you really want to use multiple different expressions within a column you need to apply the following main-logic:&lt;/P&gt;&lt;P&gt;if(Dim = 'a', expA, if(Dim = 'b', expB, ...&lt;/P&gt;&lt;P&gt;These logic could be optimized with pick(match()) whereby the listings within it could be loaded from a table and called with something like this: $(=concat(MatchValues, ',', SortField))&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 11:52:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/dynamic-variables-using-dollar-sign-expansion/m-p/1579447#M62980</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-05-13T11:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic variables using dollar sign expansion</title>
      <link>https://community.qlik.com/t5/App-Development/dynamic-variables-using-dollar-sign-expansion/m-p/1579697#M62981</link>
      <description>&lt;P&gt;Thanks for the thoughtful response Marcus!&amp;nbsp; What you described certainly matched what I observed.&lt;/P&gt;&lt;P&gt;Unfortunately, the table-ized pick(match) you described is the structure I inherited.&amp;nbsp; It worked acceptably in most other apps, but is a performance dog in this app.&lt;/P&gt;&lt;P&gt;The "value" calculation performs (mostly) acceptably, but its the threshold comparison / coloring portion that accounts for most of the drag.&amp;nbsp; Its the 76 (!) part if/match combo in this one app that I (unsuccessfully) tried to replace with the dynamic variable.&lt;/P&gt;&lt;P&gt;My remaining two options should result in some performance improvement, just not sure yet if it'll be enough.&amp;nbsp; &amp;lt;crossing fingers&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 21:10:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/dynamic-variables-using-dollar-sign-expansion/m-p/1579697#M62981</guid>
      <dc:creator>davetrentwipro</dc:creator>
      <dc:date>2019-05-13T21:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic variables using dollar sign expansion</title>
      <link>https://community.qlik.com/t5/App-Development/dynamic-variables-using-dollar-sign-expansion/m-p/1579806#M62982</link>
      <description>&lt;P&gt;I assume that the way how the multiple expressions are assigned to the rows/columns is rather not essential to the performance else the pure amount of them and of course the way in which they are defined and are interacting with the datamodel.&lt;/P&gt;&lt;P&gt;This means you might need some changes there to improve the performance. For example developing the datamodel more in the direction of a star-scheme or even a big fact-table, or pre-calculating something within the script to simplify the expressions or ...&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 07:46:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/dynamic-variables-using-dollar-sign-expansion/m-p/1579806#M62982</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-05-14T07:46:17Z</dc:date>
    </item>
  </channel>
</rss>

