<?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: Expressions in variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482399#M180280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure is this is your problem, but have you tried&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$($(v1))&amp;nbsp; or&amp;nbsp;&amp;nbsp; $(=$(v1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Nov 2013 14:14:17 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2013-11-05T14:14:17Z</dc:date>
    <item>
      <title>Expressions in variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482398#M180279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to store QV expressions in variables using Excel and a loop in the QV-script that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;for i = 0 to NoOfRows('expressions') - 1&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; let vName = peek('variablename', i, '&lt;EM&gt;expressions&lt;/EM&gt;'); // Name of the variable&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; let $(vName) = peek('Formula', i, '&lt;EM&gt;expressions&lt;/EM&gt;'); // Expression&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;next i&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this works perfectly. It generates a number of variables containing expressions. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The problem I have is that the variables I have are supposed to be in the same expression in QlikView. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So lets say that I have a variable called 'v1', to calculate this my expression would be $(v1) and it will execute the expression inside the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how do I do this for all my variables? Every variable is connected to a dimension in the table. So if I create a new variable which just says 'variablename' and put this in an expression in my table, my table will look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="asdf.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/48590_asdf.PNG.png" /&gt;&lt;/P&gt;&lt;P&gt;So I get my name of the right variable but I can't calculate the right variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you understand my problem. Any suggestions on what to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 14:00:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482398#M180279</guid>
      <dc:creator />
      <dc:date>2013-11-05T14:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions in variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482399#M180280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure is this is your problem, but have you tried&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$($(v1))&amp;nbsp; or&amp;nbsp;&amp;nbsp; $(=$(v1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 14:14:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482399#M180280</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-11-05T14:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions in variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482400#M180281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did not help I'm afraid. I get it to work if I create a new variable that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;if(variabelname='v1',$(v1),&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;if(variabelname='v2',$(v2),&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;if(variabelname='v3',$(v3)))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then use this variable as an expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 14:28:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482400#M180281</guid>
      <dc:creator />
      <dc:date>2013-11-05T14:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions in variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482401#M180282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kim, as far as I understand you want QV to evaluate a different expression for every line of your table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe this is not possible. The expression is set for all dimension values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can look into adding a pick(match() ) combination to your expression, i.e. creating one expression that caters for all your lines. I remeber one or two samples here in the forum that tried to handle mostly exactely what you are trying, but don't have much time to search for it now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 14:29:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482401#M180282</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-11-05T14:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions in variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482402#M180283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that. I will try to search for a similar solution. If anyone else has seen it, please let me know &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 14:42:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482402#M180283</guid>
      <dc:creator />
      <dc:date>2013-11-05T14:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions in variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482403#M180284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's in principle similar to what you found out by yourself:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;STRONG&gt;&lt;EM&gt;if(variabelname='v1',$(v1),&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;if(variabelname='v2',$(v2),&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;if(variabelname='v3',$(v3)))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can be also written as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=pick(match(variabelname,'v1','v2','v3', $(v1), $(v2), $(v3) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you can try to generate this expression automatically using the available variablename values and variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 14:46:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482403#M180284</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-11-05T14:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions in variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482404#M180285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if I have lets say 3 expressions (v1-v3) containing expressions, and want these calculated in one expression in a table. How to I write the expression? Do I have to create an extra variable?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 14:53:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482404#M180285</guid>
      <dc:creator />
      <dc:date>2013-11-05T14:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions in variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482405#M180286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just found one of the threads mentioned, hope this clarifies most things:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/33068"&gt;Dollar sign expansions removes dimensions&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 15:00:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482405#M180286</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-11-05T15:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions in variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482406#M180287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I got it to work now!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem for me is that I have about 90 variables with expressions which makes the calculation take a long time. Is there any faster way to calculate the right variable for the right row in a table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 15:28:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482406#M180287</guid>
      <dc:creator />
      <dc:date>2013-11-05T15:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions in variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482407#M180288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So now I've managed to make the following expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pick(index,$(variable1),$(variable2)...$(variable99))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where index is the right number for the right variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it's still to slow, which is really not that strange. Is there anyway to make this calculation faster?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 15:24:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482407#M180288</guid>
      <dc:creator />
      <dc:date>2013-11-06T15:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions in variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482408#M180289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to look at your 99 expressions and optimize those (or at least the ones that create the heavy load).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 15:28:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-in-variables/m-p/482408#M180289</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-11-06T15:28:03Z</dc:date>
    </item>
  </channel>
</rss>

