<?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 Doubts about using expresions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Doubts-about-using-expresions/m-p/1160989#M906131</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;question 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 questions about using expresion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a chart I have two expresion:&lt;/P&gt;&lt;P&gt;exp1=sum(sales)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* exp1 is the label */&lt;/P&gt;&lt;P&gt;exp2=above(sum(sales,1))&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;/* exp2 is the label */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create exp that is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exp3 = (exp1 - exp2)/exp1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I use exp1 and exp2 in the definition of exp3. I don't have this option in expresion editor. I know I can create two variables with the exp1 and exp2 and the use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exp3 = &lt;SPAN style="font-size: 13.3333px;"&gt;($(exp1) - $(exp2))/$(exp1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I only need this expresion in this char , is there nay other option??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;question2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this expresion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(sum(sales), city, product)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get this value for all data in my model and after I want to use it in several expresions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I define a var (panel variable) var=&lt;SPAN style="font-size: 13.3333px;"&gt;avg(sum(sales), city, product)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result changes and depens on the dimensions I use in my table or chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I calculate this expresion for all data and store the value in a variable??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Doubts about using expresions</title>
      <link>https://community.qlik.com/t5/QlikView/Doubts-about-using-expresions/m-p/1160989#M906131</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;question 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 questions about using expresion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a chart I have two expresion:&lt;/P&gt;&lt;P&gt;exp1=sum(sales)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* exp1 is the label */&lt;/P&gt;&lt;P&gt;exp2=above(sum(sales,1))&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;/* exp2 is the label */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create exp that is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exp3 = (exp1 - exp2)/exp1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I use exp1 and exp2 in the definition of exp3. I don't have this option in expresion editor. I know I can create two variables with the exp1 and exp2 and the use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exp3 = &lt;SPAN style="font-size: 13.3333px;"&gt;($(exp1) - $(exp2))/$(exp1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I only need this expresion in this char , is there nay other option??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;question2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this expresion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(sum(sales), city, product)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get this value for all data in my model and after I want to use it in several expresions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I define a var (panel variable) var=&lt;SPAN style="font-size: 13.3333px;"&gt;avg(sum(sales), city, product)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result changes and depens on the dimensions I use in my table or chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I calculate this expresion for all data and store the value in a variable??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Doubts-about-using-expresions/m-p/1160989#M906131</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Doubts about using expresions</title>
      <link>https://community.qlik.com/t5/QlikView/Doubts-about-using-expresions/m-p/1160990#M906133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think exp2 should probably look like&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=above(sum(sales),1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;You should be able to reference the expressions using the labels, so I think this should just work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;= (exp1 - exp2)/exp1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;How do your labels look like in your real setting? Maybe try&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;= ("exp1" - "exp2")/"exp1"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;Your other expression should probably make use of advanced aggregation:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=avg(Aggr( sum(sales), city, product))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If you definey your variable with a leading equal sign, the result should be evaluated in total context.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;You may also try&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=avg(TOTAL Aggr(sum(sales), city, product))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2016 22:21:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Doubts-about-using-expresions/m-p/1160990#M906133</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-07-01T22:21:31Z</dc:date>
    </item>
  </channel>
</rss>

