<?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: Setting Year value in a calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528301#M197426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great - Thank you!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works as I want it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Sagar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Dec 2013 16:02:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-12-05T16:02:20Z</dc:date>
    <item>
      <title>Setting Year value in a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528294#M197419</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 am creating a dashboard on a new sheet within my qliktech report which will show amongst other things Sales values, Year to date sales and margins etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following to calculate the margin:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (wh&amp;lt;&amp;gt;'EN',((Sum(if (linetype='Invoiced',(val),0)))-(Sum(if (linetype='Invoiced',(cost),0))))/(Sum(if (linetype='Invoiced',(val)))),0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine when the current sales year (2014) is selected but when a user clears all selections or selects last year or the year before etc. the values obviously all change. I want the chart to only show Margin for this year irrespective of what year/month selections are made elsewhere....can this be done? I tried set analysis but that does not seem to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My year dimension is called FinYear - hopefully you could show me a working example of the above formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help - its greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 16:40:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528294#M197419</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-04T16:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Year value in a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528295#M197420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using set analysis, selections can be ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;=sum({1}val)&lt;/P&gt;&lt;P&gt;will ignore all selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Year=,Month=&amp;gt;}val)&lt;/P&gt;&lt;P&gt;will ignore selections made in the months of Year and Month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your expression, try adding these to your sums, something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;if (wh&amp;lt;&amp;gt;'EN',((Sum({&amp;lt;Year=,Month=&amp;gt;}if (linetype='Invoiced',(val),0)))-(Sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;{&amp;lt;Year=,Month=&amp;gt;}&lt;/SPAN&gt;if (linetype='Invoiced',(cost),0))))/(Sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;{&amp;lt;Year=,Month=&amp;gt;}&lt;/SPAN&gt;if (linetype='Invoiced',(val)))),0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; 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-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;where Year, Month are your year and month fields.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; 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-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;However I can't be sure if this is your problem or not. If you could post a sample qvw that demonstrates the problem, that may help you get an answer faster. Also, how are you displaying this information? Bar chart, Straight table, Textbox?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; 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-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 18:13:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528295#M197420</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2013-12-04T18:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Year value in a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528296#M197421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;if (wh&amp;lt;&amp;gt;'EN',(Sum({&amp;lt;FinYear={2014},linetype={'Invoiced'}&amp;gt;}val)-Sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;{&amp;lt;FinYear={2014},linetype={'Invoiced'}&amp;gt;}&lt;/SPAN&gt;cost))/Sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;{&amp;lt;FinYear={2014},linetype={'Invoiced'}&amp;gt;}&lt;/SPAN&gt;val))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need more help please post a sample document that demonstrates the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 18:14:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528296#M197421</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-12-04T18:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Year value in a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528297#M197422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is my QVW file. I have tried the set analysis but it appears not to work for me - I think I must be doing something wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially I want 2014 values in my GP chart and not values for previous years even if those years are selected...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 15:20:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528297#M197422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-05T15:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Year value in a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528298#M197423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sample qvw file attached above...thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 15:21:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528298#M197423</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-05T15:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Year value in a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528299#M197424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sample qvw file attached above...thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 15:21:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528299#M197424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-05T15:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Setting Year value in a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528300#M197425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See if attached is what you are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 15:59:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528300#M197425</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2013-12-05T15:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Year value in a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528301#M197426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great - Thank you!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works as I want it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Sagar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 16:02:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Year-value-in-a-calculation/m-p/528301#M197426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-05T16:02:20Z</dc:date>
    </item>
  </channel>
</rss>

