<?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: Re: Re: How to calculate variable values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712131#M256363</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oh you are totally right and i was too fast to post the final sample.&amp;nbsp; Please find attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main things i needed to changed from your original sample:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;remove&amp;nbsp; '=' from the beginning of all variable definitions&lt;/P&gt;&lt;P&gt;add&amp;nbsp; isnull checks to all variables and assign 0 if its null:&amp;nbsp;&amp;nbsp;&amp;nbsp; ex:&amp;nbsp;&amp;nbsp;&amp;nbsp; if(&amp;nbsp; isnull(&amp;nbsp; &amp;lt;expression&amp;gt;) = -1, 0, &amp;lt;expression&amp;gt; )&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because when you add values, if any of the components is null the whole total is null too. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this sample please. apologies again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Sep 2014 17:49:01 GMT</pubDate>
    <dc:creator>JonnyPoole</dc:creator>
    <dc:date>2014-09-04T17:49:01Z</dc:date>
    <item>
      <title>How to calculate variable values</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712124#M256356</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 have created the following variables and when I tried to total them I don't get the correct results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vClient = Aggr(Sum({&amp;lt;Client={A,B,C,D,E,F,G}&amp;gt;} [YTD Hours]), EmpID)&lt;/P&gt;&lt;P&gt;vProduct = Aggr(Sum({&amp;lt;Product = {AB}&amp;gt;} [YTD Hours]), EmpID)&lt;/P&gt;&lt;P&gt;vEFclient = Aggr(Sum({&amp;lt;Client={ABCD, EFGH, IJKL, MNOP, QRST, UVWX}&amp;gt;}[YTD Hours]), EmpID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I created another variable for Total Hours as:&lt;/P&gt;&lt;P&gt;vTotalHours =$(vClient) + $(vProduct) + $(vEFclient)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a straight table chart where there is a column name Total Hours and on the edit expression I put&lt;/P&gt;&lt;P&gt;=$(vTotalHours), however the results I am getting is not correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any body please explain what I miss here or suggest the correct methods to calculate?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Wossen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 14:33:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712124#M256356</guid>
      <dc:creator>wossenhh</dc:creator>
      <dc:date>2014-09-04T14:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate variable values</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712125#M256357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Provide sample / Dummy Data..plz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 14:38:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712125#M256357</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-09-04T14:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate variable values</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712126#M256358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree that a sample would help.&amp;nbsp; As a stab, sometimes expressions work better when you wrap the aggr() in a external sum like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(&amp;nbsp; Aggr(&amp;nbsp; &amp;lt;chartaggregation&amp;gt;,&amp;lt;dimension&amp;gt;) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may also need to remove any preceding '=' signs from the variable definitions of the first 3 variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do the individual variables work in the chart $(vClient)&amp;nbsp; ?&amp;nbsp; ...focus on getting those parts working first before you do the sum of variables variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 14:54:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712126#M256358</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-09-04T14:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to calculate variable values</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712127#M256359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I attached the dummy QV&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 16:02:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712127#M256359</guid>
      <dc:creator>wossenhh</dc:creator>
      <dc:date>2014-09-04T16:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to calculate variable values</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712128#M256360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The individual variable works in the chart. The problem I have is when I add them up using variables formula for the Total Hours. I attached the dummy sample as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Wossen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 16:04:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712128#M256360</guid>
      <dc:creator>wossenhh</dc:creator>
      <dc:date>2014-09-04T16:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: How to calculate variable values</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712129#M256361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i switched the syntax around a bit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check it out&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 16:51:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712129#M256361</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-09-04T16:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to calculate variable values</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712130#M256362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you see the Client column and the Total Hours column, they have the same results, which is not correct. The Total hours should be reflect the aggregate hours for Client, Product and EF Client per Employee ID&lt;/P&gt;&lt;P&gt;for e.g. for Emp ID 001 the total hours should be 170, for 002 it should be 75 and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it is clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 17:02:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712130#M256362</guid>
      <dc:creator>wossenhh</dc:creator>
      <dc:date>2014-09-04T17:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: How to calculate variable values</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712131#M256363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oh you are totally right and i was too fast to post the final sample.&amp;nbsp; Please find attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main things i needed to changed from your original sample:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;remove&amp;nbsp; '=' from the beginning of all variable definitions&lt;/P&gt;&lt;P&gt;add&amp;nbsp; isnull checks to all variables and assign 0 if its null:&amp;nbsp;&amp;nbsp;&amp;nbsp; ex:&amp;nbsp;&amp;nbsp;&amp;nbsp; if(&amp;nbsp; isnull(&amp;nbsp; &amp;lt;expression&amp;gt;) = -1, 0, &amp;lt;expression&amp;gt; )&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because when you add values, if any of the components is null the whole total is null too. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this sample please. apologies again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 17:49:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712131#M256363</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-09-04T17:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to calculate variable values</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712132#M256364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jonathan! That works well!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 21:03:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variable-values/m-p/712132#M256364</guid>
      <dc:creator>wossenhh</dc:creator>
      <dc:date>2014-09-04T21:03:42Z</dc:date>
    </item>
  </channel>
</rss>

