<?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 make dynamic expressions work? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477615#M178415</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To get this to work, I added some load script:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/50382_pastedImage_0.png" style="width: 620px; height: 351px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then on the straight table, I just made the dimension [KPI naam] and the expression is $(vMetrics).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attached to see it in action.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Dec 2013 15:00:09 GMT</pubDate>
    <dc:creator>Nicole-Smith</dc:creator>
    <dc:date>2013-12-12T15:00:09Z</dc:date>
    <item>
      <title>How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477613#M178413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello QlikCommunity,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some advice on how I can best solve my problem.&lt;/P&gt;&lt;P&gt;I have a long list of KPI's (lets say 100) and I want to present these in a chart (lets say a straight table). On the rows, the KPI's are listed, and in the columns the value and target of the KPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem however is, that the expression of..... &lt;BR /&gt;- KPI nr 1 could be an expression with sum (e.g. sum(value) )&lt;BR /&gt;- KPI nr 2 could be an expression with avg (e.g. avg(value) )&lt;BR /&gt;- KPI nr 3 could be an expression with count (e.g. count(value) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I thought that could work, is load my expression (like the ones mentioned above) along with my KPI-definitions, as a separate column in my datamodel, so I can use this (loaded) expression in my chart to calculate the sum, average or count when needed (of course all in 1 and the same column).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't get it working! So my questions are: &lt;BR /&gt;[1] Who can make this work? (and help me out how)&lt;BR /&gt;[2] If the answer on [1] == nobody, please answer if this indeed is not possible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached I have an example application, where I have loaded my expressionsin the loadscript, and tried to make it work (but the column indicates only "-" (null). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What the outcome _should_ be is also listed, because an alternative approache _does_ work (the nested if statement)&lt;/P&gt;&lt;P&gt;pseudo: &lt;BR /&gt;- if (KPInr = 1;sum(value);avg(value)) &lt;/P&gt;&lt;P&gt;But If I implement this nested if statement for about 100 KPI's, &lt;BR /&gt;&lt;A&gt; my code looks like spaghetti&lt;BR /&gt;&lt;B&gt; I'm afraid that the performance may not be good&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you have some advice for me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The .qvw also is self-explanatory IMO but feel free to ask additional info when things are unclear.&lt;/P&gt;&lt;P&gt;Roberto&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: other approaches are also welcome, as long as it is a (good) alternative for the nestedIf (100x) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 12:14:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477613#M178413</guid>
      <dc:creator />
      <dc:date>2013-12-12T12:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477614#M178414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe it won't work like you want it to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can only define a single expression per chart, you can't change the expression for each dimension value (i.e. create an expression based on current dimension value, e.g. using dollar sign expansions).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create a single expression that checks the dimension value, then switch to an expression to use accordingly (like you've done with your nested if()'s, or similar using pick/ match combination).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 14:23:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477614#M178414</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-12-12T14:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477615#M178415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To get this to work, I added some load script:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/50382_pastedImage_0.png" style="width: 620px; height: 351px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then on the straight table, I just made the dimension [KPI naam] and the expression is $(vMetrics).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attached to see it in action.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 15:00:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477615#M178415</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2013-12-12T15:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477616#M178416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, Nicole, that's a single expression with the mentioned pick/match combination (similar to the nested if() statements Roberto is using).&lt;/P&gt;&lt;P&gt;It's not what I think he is referring to as a 'dynamic expression' (which I believe is not feasable).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 15:05:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477616#M178416</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-12-12T15:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477617#M178417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at the ValueList(), ValueLoop() functions to create dynamic dimensions. Maybe you'll come up with an alternative displaying your KPI using those.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 15:09:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477617#M178417</guid>
      <dc:creator>simondachstr</dc:creator>
      <dc:date>2013-12-12T15:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477618#M178418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're correct--it's not feasible loading it in from a file.&amp;nbsp; I just thought I'd give him something to go off of that actually works, since it's sometimes hard to understand without seeing an example &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 15:09:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477618#M178418</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2013-12-12T15:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477619#M178419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To be clear, I am not saying anything against your proposed solution, that's what I also had in mind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am just saying, something like this might be a work around for what Roberto was trying to achieve with something I believe just won't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 15:14:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477619#M178419</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-12-12T15:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477620#M178420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nicole and others, Thanks for all the (quick!) answers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nicole's approach works in my small project. I wonder: can we say something on performance? would one of the mentioned approaches be preferred (and why)?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Current options are&lt;/P&gt;&lt;P&gt;- nested if&lt;/P&gt;&lt;P&gt;- this pick-match approach&lt;/P&gt;&lt;P&gt;- the valueloop / valuelist (which I find a bit hard to understand; I'll try to find out later...)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It would be great if we can say something on what would be the best approach. Thanks!&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 15:44:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477620#M178420</guid>
      <dc:creator />
      <dc:date>2013-12-12T15:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477621#M178421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can find some performance info on the pick-match approach here: &lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/message/286947#286947" title="http://community.qlik.com/message/286947#286947"&gt;http://community.qlik.com/message/286947#286947&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've always considered pick-match to be better than nested ifs, but someone can correct me if I'm wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're using valueloop/valuelist, you will need nested ifs or pick-match anyway, which just adds more complexity to your solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 15:49:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477621#M178421</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2013-12-12T15:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477622#M178422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 15:58:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477622#M178422</guid>
      <dc:creator />
      <dc:date>2013-12-12T15:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477623#M178423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As a first optimization, you can skip the match() and just use the KPI number:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vMetrics = 'Pick([KPI nr],' &amp;amp;&amp;nbsp; peek('ConcatExpression') &amp;amp; ')';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not 100% sure how much better a pick() (/match() ) perform compared to nested if() statements, at least IMHO it's better to read and maintain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 16:24:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477623#M178423</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-12-12T16:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477624#M178424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;why don't you use this simple solution and take Column(2) as your expression instead of $(=expressie).&lt;/P&gt;&lt;P&gt;This gives the same result as your nested if and should perform 100 times better. &lt;/P&gt;&lt;P&gt; Please try&lt;IMG alt="Column(2).jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/50430_Column(2).jpg" /&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Burkhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 15:59:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477624#M178424</guid>
      <dc:creator>veidlburkhard</dc:creator>
      <dc:date>2013-12-13T15:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477625#M178425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Burkhard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I doubt if you understood my problem right!? Column(2) refers to the nested-if-expression (or do I misunderstand you?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not: I want to get rid of the nested-if-construction and have another way of calculating.&lt;/P&gt;&lt;P&gt;Column(2) is IMO not a solution, since that REFERS to a method (like the nested if method or the pick(match) method or some other...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I didn't understand you correctly can you share your .qvw and explain why it would be better / faster?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 16:08:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477625#M178425</guid>
      <dc:creator />
      <dc:date>2013-12-13T16:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477626#M178426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's giving the same result as the nested if() statements, because it's just referencing the nested if() expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try your chart with the nested if() expression removed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 16:08:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477626#M178426</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-12-13T16:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477627#M178427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, swuehl,&lt;/P&gt;&lt;P&gt;this was too simple...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 16:34:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477627#M178427</guid>
      <dc:creator>veidlburkhard</dc:creator>
      <dc:date>2013-12-13T16:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to make dynamic expressions work?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477628#M178428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;No problem. I'm already happy with all &lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;answers&lt;/SPAN&gt; so far.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Dec 2013 13:11:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-make-dynamic-expressions-work/m-p/477628#M178428</guid>
      <dc:creator />
      <dc:date>2013-12-14T13:11:09Z</dc:date>
    </item>
  </channel>
</rss>

