<?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 with variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expressions-with-variables/m-p/487397#M1146682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try with Column() function, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Column(1)/Column(2))*12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, in your case&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Ex1/Ex2)*12&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Aug 2013 07:16:17 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2013-08-13T07:16:17Z</dc:date>
    <item>
      <title>Expressions with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-with-variables/m-p/487396#M1146681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am new with QlikView and have a problem using variables:&lt;/P&gt;&lt;P&gt;I have defined the following variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v1:&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[Type]={'Apples'}&amp;gt;} [Total value])+&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[Type]={'Oranges'}&amp;gt;} [Total value])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v2:&lt;/P&gt;&lt;P&gt;COUNT(DISTINCT {$&amp;lt;[Invoice]={'Main'}&amp;gt;}InvoiceMonth)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have uploaded the 3 different invoices with the values of the Apples and Oranges&lt;/P&gt;&lt;P&gt;v1: Gives me the total cost of Apples and Oranges.&lt;/P&gt;&lt;P&gt;v2: Gives me the number of invoices I have loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get the average cost and then extrapolate it for the whole year. I have defined the valariables as I have diferent types of invoices and that have been uploaded in different periods. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I include in a table the following expressoins:&lt;/P&gt;&lt;P&gt;Ex1 =$(v1)&amp;nbsp; and I get the correct sum: 992.19&lt;/P&gt;&lt;P&gt;Ex2 =$(v2) and I get the correct number of invoices: 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in a new expression I add:&lt;/P&gt;&lt;P&gt;=($(v1)/$(v2))*12&lt;/P&gt;&lt;P&gt;And the result is 5424.44 which is incorrect as (992.19/3)*12 = 3968.76&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the names of the expressions Ex1 and Ex2 it works fine, but I want to use the variables as the expressions are only there for testing!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me with this?&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 07:09:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-with-variables/m-p/487396#M1146681</guid>
      <dc:creator />
      <dc:date>2013-08-13T07:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-with-variables/m-p/487397#M1146682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try with Column() function, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Column(1)/Column(2))*12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, in your case&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Ex1/Ex2)*12&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 07:16:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-with-variables/m-p/487397#M1146682</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-08-13T07:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-with-variables/m-p/487398#M1146683</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v3 = &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;$(v1)/$(v2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Ex3 =$(v3)*12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Hope it helps&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 07:17:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-with-variables/m-p/487398#M1146683</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2013-08-13T07:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-with-variables/m-p/487399#M1146684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, This worked fine, but still can not understand why a new variable is needed!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 06:27:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-with-variables/m-p/487399#M1146684</guid>
      <dc:creator />
      <dc:date>2013-08-14T06:27:51Z</dc:date>
    </item>
  </channel>
</rss>

