<?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: Pivot-table layout and data-model problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671449#M538690</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This solves the problem in the example-file, thanks!&lt;/P&gt;&lt;P&gt;(Tried it before but forgot a dimension in it)&lt;/P&gt;&lt;P&gt;In the real application there there are more categories than sales and cost and some of them are not included in the forecast, then this solution will get the result for these which is wrong.&lt;/P&gt;&lt;P&gt;If I modify the example and remove the forecast for Category=Sales then in September (there is a forecast as well as a result) the figures for Cost will come from the forecast (Correct) but for the Sales it will be the Result-figures which is incorrect since I would like that to be 0 or null();&lt;/P&gt;&lt;P&gt;Maybe the best solution is to add a forecast of 0 and in the IF-condition look for a _ForecastFlag instead?&lt;/P&gt;&lt;P&gt;/Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Sep 2014 07:13:03 GMT</pubDate>
    <dc:creator>andy</dc:creator>
    <dc:date>2014-09-12T07:13:03Z</dc:date>
    <item>
      <title>Pivot-table layout and data-model problem</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671443#M538684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;I want to create something looking like this in Qlikview 11&lt;/P&gt;&lt;P&gt;&lt;IMG alt="ForecastTableTemplate.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/66494_ForecastTableTemplate.PNG.png" style="width: 620px; height: 72px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The rule is that if there is a forecast-value that one shall be presented otherwise the result.&lt;/P&gt;&lt;P&gt;I have come somewhat near the layout above by taking sum(Result+Forecast) and also the budget for every month and then letting the built-in Total replace the 'Full Year'-columns.&lt;/P&gt;&lt;P&gt;Findings:&lt;/P&gt;&lt;P&gt;-The problem with sum(Result+Forecast) comes when there is both a result and a forecast for a month then we get into problem with almost double the true values. &lt;/P&gt;&lt;P&gt;-The problem with if(sum(Forecast)&amp;gt;0,sum(Forecast),sum(Result)) comes when looking at the total which will only contain the forecasts...&lt;/P&gt;&lt;P&gt;- A column cannot be hidden in a Pivot-table.&lt;/P&gt;&lt;P&gt;- Set-analysis cannot be used since it depends on a dimension and is only evaluated once per object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a small qvw example which is attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any hints are highly appreciated&lt;/P&gt;&lt;P&gt;brgds&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 19:50:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671443#M538684</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2014-09-10T19:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot-table layout and data-model problem</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671444#M538685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andreas,&lt;/P&gt;&lt;P&gt;Can not open your personal edition document.&lt;/P&gt;&lt;P&gt;How about using this expression&lt;/P&gt;&lt;P&gt;=SUM( If (Forecast &amp;gt;0, Forecast, Result))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above expression evaluates the condition for each record and then sum up the output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kalpesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 21:00:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671444#M538685</guid>
      <dc:creator />
      <dc:date>2014-09-10T21:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Pivot-table layout and data-model problem</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671445#M538686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Strange with the file, if my Qlikview lost the license and started in Personal Edition that should not stop you from opening the document. If you have a license you can open any file. Anyway I have re-attached the qvw now stored within a licensed Qlikview,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding you hint, since the data for result, budget and forecast are concatenated the values&amp;nbsp; do not stay on the same rows so that if-condition will result in the same result as sum(Result) + sum(ForecastResult)&lt;/P&gt;&lt;P&gt;Thanks anyway!&lt;/P&gt;&lt;P&gt;/Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 05:34:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671445#M538686</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2014-09-11T05:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot-table layout and data-model problem</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671446#M538687</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;How about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(Aggr(If(Sum(ForecastResult)&amp;lt;&amp;gt;0, Sum(ForecastResult), Sum(Result)), Year, Category, Costcenter, Month))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 05:56:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671446#M538687</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-09-11T05:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Pivot-table layout and data-model problem</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671447#M538688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In expression if(sum(ForecastResult)&amp;gt;0, sum(ForecastResult),sum(Result)), the values returned are not as the same as sum(Result) + sum(ForecastResult), becuase the dimensions it is based on. That yields the same result as you showed as desired result in your attached qvw file. (I made a small change in the attachment to show the diff between expressions).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case you do not want the result as if(sum(ForecastResult)&amp;gt;0, sum(ForecastResult),sum(Result)), could you please specify what are the dimension conditions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA.&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, 11 Sep 2014 09:17:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671447#M538688</guid>
      <dc:creator />
      <dc:date>2014-09-11T09:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Pivot-table layout and data-model problem</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671448#M538689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;As mentioned in the first post&lt;/P&gt;&lt;P&gt;-"&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;-The problem with if(sum(Forecast)&amp;gt;0,sum(Forecast),sum(Result)) comes when looking at the total which will only contain the forecasts...&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The total column only sum the Forecast-values, the other columns are as wanted.&lt;/P&gt;&lt;P&gt;/Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 06:46:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671448#M538689</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2014-09-12T06:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Pivot-table layout and data-model problem</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671449#M538690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This solves the problem in the example-file, thanks!&lt;/P&gt;&lt;P&gt;(Tried it before but forgot a dimension in it)&lt;/P&gt;&lt;P&gt;In the real application there there are more categories than sales and cost and some of them are not included in the forecast, then this solution will get the result for these which is wrong.&lt;/P&gt;&lt;P&gt;If I modify the example and remove the forecast for Category=Sales then in September (there is a forecast as well as a result) the figures for Cost will come from the forecast (Correct) but for the Sales it will be the Result-figures which is incorrect since I would like that to be 0 or null();&lt;/P&gt;&lt;P&gt;Maybe the best solution is to add a forecast of 0 and in the IF-condition look for a _ForecastFlag instead?&lt;/P&gt;&lt;P&gt;/Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 07:13:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671449#M538690</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2014-09-12T07:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Pivot-table layout and data-model problem</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671450#M538691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;I added a new table in the script holding a flag F or P for every month and forecast-label and then look at that flag in the The sum(Aggr expression posted by Jonathan. This should work for all the scenarios I can think of at the moment.&lt;/P&gt;&lt;P&gt;I attach the solution&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;/Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 08:52:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-layout-and-data-model-problem/m-p/671450#M538691</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2014-09-12T08:52:16Z</dc:date>
    </item>
  </channel>
</rss>

