<?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 Error in calculated dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Error-in-calculated-dimension/m-p/215567#M68987</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a straight table with a calculated dimension that goes:&lt;/P&gt;&lt;P&gt;=Sum(If(year(Today())*100+Week(Today())-1 &amp;lt; YEARWEEK +4, DEMANDED_QTY))&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;=If(year(Today())*100+Week(Today())-1 &amp;lt; YEARWEEK +4, Sum(DEMANDED_QTY))&lt;/P&gt;&lt;P&gt;But I get "Error in calculated dimension" in both methods&lt;/P&gt;&lt;P&gt;If I use&lt;/P&gt;&lt;P&gt;=If(year(Today())*100+Week(Today())-1 &amp;lt; YEARWEEK +4, DEMANDED_QTY)&lt;/P&gt;&lt;P&gt;The dimension works but I get one row per YEARWEEK ( I think)&lt;/P&gt;&lt;P&gt;I want to get the total amount demanded for the last 4 weeks on one row.&lt;/P&gt;&lt;P&gt;Anyone that has any ideas of what I'm doing wrong?&lt;/P&gt;&lt;P&gt;I tried moving the function to expressions and then it worked so I guess my problem is solved.&lt;/P&gt;&lt;P&gt;But I still would like to know why I can not do this as a dimension...&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Sep 2010 13:18:54 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-09-23T13:18:54Z</dc:date>
    <item>
      <title>Error in calculated dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-calculated-dimension/m-p/215567#M68987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a straight table with a calculated dimension that goes:&lt;/P&gt;&lt;P&gt;=Sum(If(year(Today())*100+Week(Today())-1 &amp;lt; YEARWEEK +4, DEMANDED_QTY))&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;=If(year(Today())*100+Week(Today())-1 &amp;lt; YEARWEEK +4, Sum(DEMANDED_QTY))&lt;/P&gt;&lt;P&gt;But I get "Error in calculated dimension" in both methods&lt;/P&gt;&lt;P&gt;If I use&lt;/P&gt;&lt;P&gt;=If(year(Today())*100+Week(Today())-1 &amp;lt; YEARWEEK +4, DEMANDED_QTY)&lt;/P&gt;&lt;P&gt;The dimension works but I get one row per YEARWEEK ( I think)&lt;/P&gt;&lt;P&gt;I want to get the total amount demanded for the last 4 weeks on one row.&lt;/P&gt;&lt;P&gt;Anyone that has any ideas of what I'm doing wrong?&lt;/P&gt;&lt;P&gt;I tried moving the function to expressions and then it worked so I guess my problem is solved.&lt;/P&gt;&lt;P&gt;But I still would like to know why I can not do this as a dimension...&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 13:18:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-calculated-dimension/m-p/215567#M68987</guid>
      <dc:creator />
      <dc:date>2010-09-23T13:18:54Z</dc:date>
    </item>
    <item>
      <title>Error in calculated dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-calculated-dimension/m-p/215568#M68988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin,&lt;/P&gt;&lt;P&gt;In general, when you use aggregation in calculated dimension (sum in your case), you have to use aggr() function around it to tell what you're aggregating by. This explains the error. I cannot tell what excatly it should be in your case without knowing your data model and you want to see in the table.&lt;BR /&gt;I guess moving it to expression was the correct choice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 13:47:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-calculated-dimension/m-p/215568#M68988</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-09-23T13:47:45Z</dc:date>
    </item>
  </channel>
</rss>

