<?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 Setting an expression as a variable. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Setting-an-expression-as-a-variable/m-p/282029#M708418</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the tip.&lt;/P&gt;&lt;P&gt;But where do I put this?&lt;/P&gt;&lt;P&gt;So, I must change LET vMetrics = 'pick(MetricSequence,' &amp;amp; peek('AllExpressions') &amp;amp; ')'; to &lt;/P&gt;&lt;P&gt;LET vMetrics = 'pick(MetricSequence,AllExpressions)';??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Sep 2011 02:22:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-09-23T02:22:30Z</dc:date>
    <item>
      <title>Setting an expression as a variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-an-expression-as-a-variable/m-p/282026#M708415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on an app that allows a user to select which expressions to be visible on the chart. ( I've attached the .qvw test)&lt;/P&gt;&lt;P&gt;I've created an inline table which uses a variable for each expression, but it doesn't seem to be referencing the variables correctly-so it seems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've defined each variable:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set vAvg='AVG([Actual value])';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set vGroup1='AVG({$&amp;lt;Institution={[ECSXIYXBHRU HLCDTNSMCJ (RVQNOMBWF EOJFKWLJXVL)],[XMVCOCEF WKH HSMEEZ RVENBEX]}&amp;gt;}[Actual value])';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then in the inline table it uses these like so:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Metric:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;replace LOAD recno() as MetricSequence,* &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Metric, Expression&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Average, $(vAvg)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Group1, $(vGroup1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately it isn't really working in the radar chart.&lt;/P&gt;&lt;P&gt;Any ideas on how I can change this, or help.&lt;/P&gt;&lt;P&gt;I need to get this functionality working, as not everyone will have version 11(conditional expression show)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much appreciated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2011 13:29:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-an-expression-as-a-variable/m-p/282026#M708415</guid>
      <dc:creator />
      <dc:date>2011-09-22T13:29:51Z</dc:date>
    </item>
    <item>
      <title>Setting an expression as a variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-an-expression-as-a-variable/m-p/282027#M708416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this expression: &lt;/P&gt;&lt;P&gt;sum(aggr(sum({$&amp;lt;Institution= p(Institution2) &amp;gt;} [Actual value]*[Number of Respondents]),[Question number]))&lt;/P&gt;&lt;P&gt;/sum({$&amp;lt;Institution= p(Institution2) &amp;gt;} [Number of Respondents])&lt;/P&gt;&lt;P&gt;which I'd like to put into a variable. ie. vPeerGroup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is my script : &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SET vMyGroup='sum("Actual value")';&lt;/P&gt;&lt;P&gt;SET vAvg='avg("Actual value")';&lt;/P&gt;&lt;P&gt;SET vPeerGroup=&lt;/P&gt;&lt;P&gt;sum(aggr(sum({$&amp;lt;Institution= p(Institution2) &amp;gt;} [Actual value]*[Number of Respondents]),[Question number]))&lt;/P&gt;&lt;P&gt;/sum({$&amp;lt;Institution= p(Institution2) &amp;gt;} [Number of Respondents])';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Metric:&lt;/P&gt;&lt;P&gt;replace LOAD recno() as MetricSequence,* &lt;/P&gt;&lt;P&gt;INLINE [&lt;/P&gt;&lt;P&gt;Metric, Expression&lt;/P&gt;&lt;P&gt;&amp;nbsp; My Group, $(vMyGroup)&lt;/P&gt;&lt;P&gt;&amp;nbsp; Average, $(vAvg)&lt;/P&gt;&lt;P&gt;&amp;nbsp; Peer Group, $(vPeerGroup)&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;Metrics:&lt;/P&gt;&lt;P&gt;replace LOAD concat(Expression,',',MetricSequence) as AllExpressions&lt;/P&gt;&lt;P&gt;RESIDENT Metric;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LET vMetrics = 'pick(MetricSequence,' &amp;amp; peek('AllExpressions') &amp;amp; ')';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DROP TABLE Metrics;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I need some help with the vPeerGroup variable, as I think it needs '' and to be changed a bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2011 22:40:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-an-expression-as-a-variable/m-p/282027#M708416</guid>
      <dc:creator />
      <dc:date>2011-09-22T22:40:34Z</dc:date>
    </item>
    <item>
      <title>Setting an expression as a variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-an-expression-as-a-variable/m-p/282028#M708417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There was a expression error in vMetrics. I modified it as following and radar chart is working.&lt;/P&gt;&lt;P&gt;pick(MetricSequence,AVG([Actual value]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2011 00:50:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-an-expression-as-a-variable/m-p/282028#M708417</guid>
      <dc:creator />
      <dc:date>2011-09-23T00:50:08Z</dc:date>
    </item>
    <item>
      <title>Setting an expression as a variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-an-expression-as-a-variable/m-p/282029#M708418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the tip.&lt;/P&gt;&lt;P&gt;But where do I put this?&lt;/P&gt;&lt;P&gt;So, I must change LET vMetrics = 'pick(MetricSequence,' &amp;amp; peek('AllExpressions') &amp;amp; ')'; to &lt;/P&gt;&lt;P&gt;LET vMetrics = 'pick(MetricSequence,AllExpressions)';??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2011 02:22:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-an-expression-as-a-variable/m-p/282029#M708418</guid>
      <dc:creator />
      <dc:date>2011-09-23T02:22:30Z</dc:date>
    </item>
    <item>
      <title>Setting an expression as a variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-an-expression-as-a-variable/m-p/282030#M708419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your current output of vMetric is &lt;STRONG&gt;pick(MetricSequence,AVG([Actual value)&lt;/STRONG&gt;. Tweak your function to get the value as, pick(MetricSequence,AVG([Actual value])). I couldnt test as reload wont work as well as Metrics table is dropped.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recommend to not drop metrics table and dynamically calcuate vMetric. It will help you to include more dynamic expression selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this works out,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2011 16:52:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-an-expression-as-a-variable/m-p/282030#M708419</guid>
      <dc:creator />
      <dc:date>2011-09-23T16:52:01Z</dc:date>
    </item>
  </channel>
</rss>

