<?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 calculating an expression using only 1 reference in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/calculating-an-expression-using-only-1-reference/m-p/163207#M36388</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks, it doesn't seem to work.&lt;/P&gt;&lt;P&gt;This is the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=NUM(Sum( {&amp;lt; Jaar={$(=(Year(Today()))}&amp;gt;} toegestaan) + Sum ({{&amp;lt; Jaar={$(=(Year(Today()))}&amp;gt;} (Last year),'#.##0,00')&lt;/P&gt;&lt;P&gt;I suppose I must change your {Year={ into Jaar= because that is my selection (Year in Dutch = Jaar)&lt;/P&gt;&lt;P&gt;I changed Allowed into toegestaan, because that is my translation in Dutch and also the right name of de databasefield. Do I have a problem with Last year? Does Qlikview know what that means?&lt;/P&gt;&lt;P&gt;Thanks for trying to help me.&lt;/P&gt;&lt;P&gt;Yvonne&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Mar 2010 15:07:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-03-01T15:07:44Z</dc:date>
    <item>
      <title>calculating an expression using only 1 reference</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-an-expression-using-only-1-reference/m-p/163205#M36386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H4&gt;Hi,&lt;/H4&gt;&lt;P&gt;I hope i'm posting in the right forum. If I'm not, pls forgive me.&lt;/P&gt;&lt;P&gt;I have a set of data for counting absence of personel.&lt;/P&gt;&lt;P&gt;Of course it starts with the calculation of the hours personel can take vacation. This is already done in my database.&lt;/P&gt;&lt;P&gt;Now here's the problem. When I collect the data in Qlikview I have records looking like this:&lt;/P&gt;&lt;P&gt;date allowed last year used employeenr&lt;/P&gt;&lt;P&gt;01-01-2010 80 10 5 101&lt;/P&gt;&lt;P&gt;I have made a textbox where I want to calculate all the allowed hours. This is my formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;B&gt;num&lt;/B&gt;((&lt;B&gt;sum&lt;/B&gt;(&lt;B&gt;allowed&lt;/B&gt;)+&lt;B&gt;sum&lt;/B&gt;(last year)),'#.##0,00')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works great, untill the selection is not only a Year, but also a month.&lt;/P&gt;&lt;P&gt;How can I change this formula so it only looks at the selected Year? If the user makes the selection 2010 and (for example) march, it stil has to calculate the sum at the beginning of the year. It would totally be great if, when the user makes no selection, it calculates the Year out of todays date.&lt;/P&gt;&lt;P&gt;Since English is not my language, I hope you understand what I mean,&lt;/P&gt;&lt;P&gt;thanks in advance,&lt;/P&gt;&lt;P&gt;Yvonne&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Mar 2010 14:28:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-an-expression-using-only-1-reference/m-p/163205#M36386</guid>
      <dc:creator />
      <dc:date>2010-03-01T14:28:26Z</dc:date>
    </item>
    <item>
      <title>calculating an expression using only 1 reference</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-an-expression-using-only-1-reference/m-p/163206#M36387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;You can use set analysis to enable you to always choose a default year which in this case would be 2010. A set analysis expression solution to your text box could be for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;NUM(Sum( {&amp;lt; Year={$(=(Year(Today()))}&amp;gt;} Allowed) + Sum ({{&amp;lt; Year={$(=(Year(Today()))}&amp;gt;} (Last year),'#.##0,00')&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;You could also code it such that the higher value of Year in your calendar is always chosen, assuming you have a calendar to go with your table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;NUM(Sum( {&amp;lt; Year={$(=(MAX(Year)}&amp;gt;} Allowed) + Sum ({{&amp;lt; Year={$(=(MAX(Year)}&amp;gt;} (Last year),'#.##0,00')&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope it helps you on your way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Mar 2010 14:50:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-an-expression-using-only-1-reference/m-p/163206#M36387</guid>
      <dc:creator />
      <dc:date>2010-03-01T14:50:47Z</dc:date>
    </item>
    <item>
      <title>calculating an expression using only 1 reference</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-an-expression-using-only-1-reference/m-p/163207#M36388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks, it doesn't seem to work.&lt;/P&gt;&lt;P&gt;This is the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=NUM(Sum( {&amp;lt; Jaar={$(=(Year(Today()))}&amp;gt;} toegestaan) + Sum ({{&amp;lt; Jaar={$(=(Year(Today()))}&amp;gt;} (Last year),'#.##0,00')&lt;/P&gt;&lt;P&gt;I suppose I must change your {Year={ into Jaar= because that is my selection (Year in Dutch = Jaar)&lt;/P&gt;&lt;P&gt;I changed Allowed into toegestaan, because that is my translation in Dutch and also the right name of de databasefield. Do I have a problem with Last year? Does Qlikview know what that means?&lt;/P&gt;&lt;P&gt;Thanks for trying to help me.&lt;/P&gt;&lt;P&gt;Yvonne&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Mar 2010 15:07:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-an-expression-using-only-1-reference/m-p/163207#M36388</guid>
      <dc:creator />
      <dc:date>2010-03-01T15:07:44Z</dc:date>
    </item>
  </channel>
</rss>

