<?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: YTD Calc using SelectedYearVariable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547369#M482602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Fiscal_Year={"$(=vBrokerageSelectedYear-1)"},Fiscal_Year_Earned=,I_Month=,I_Month_Earned=,Invoice_Period_Field={"&amp;lt;=$(=(Addmonths(today(),-12)))"}&amp;gt;}Net_Income)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Aug 2013 07:22:35 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2013-08-01T07:22:35Z</dc:date>
    <item>
      <title>YTD Calc using SelectedYearVariable</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547364#M482597</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 need to calculate Net Income comparing Selected Fiscal YTD to Previous Fiscal YTD (ie. July 1-August 1, 2013 compared to July 1-August 1, 2012). I have a variable that drives which year is selected 'vBrokerageSelectedYear' which looks likes this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vBrokerageSelectedYear=&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;IsNull&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;(Fiscal_Year&lt;/SPAN&gt;),&lt;SPAN style="color: #0000ff;"&gt;Year&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;addmonths&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Today&lt;/SPAN&gt;(),6)),&lt;SPAN style="color: #800000;"&gt;Fiscal_Year&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't change the variable because it drives many other tabs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the expression I'm using to try and calculate the previous year's &lt;SPAN style="color: #800000;"&gt;Net_Income&lt;/SPAN&gt; based on &lt;SPAN style="color: #800000;"&gt;Fiscal_Year&lt;/SPAN&gt; and &lt;SPAN style="color: #800000;"&gt;Invoice_Period_Field&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;SPAN style="color: #0000ff;"&gt;num&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;(&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&amp;lt;Fiscal_Year&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"$(&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;vBrokerageSelectedYear&lt;SPAN style="color: #000000;"&gt;-1&lt;/SPAN&gt;)"&lt;SPAN style="color: #000000;"&gt;},&lt;/SPAN&gt;Fiscal_Year_Earned&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;I_Month&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;I_Month_Earned&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt; Invoice_Period_Field&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;$(&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Num(Date#(Day(today())&amp;amp;'-'&amp;amp;Month(Today())&amp;amp;'-'&amp;amp;(vBrokerageSelectedYear&lt;SPAN style="color: #000000;"&gt;-1&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;'DD-MMM-YY')&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;0))"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Net_Income)&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;'$#,##0')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression returns the FULL Previous Fiscal Year, not YTD. I believe the problem lies somewhere in the &lt;SPAN style="color: #800000;"&gt;Invoice_Period_Field&lt;/SPAN&gt; part of the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any assistance would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 02:41:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547364#M482597</guid>
      <dc:creator />
      <dc:date>2013-08-01T02:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Calc using SelectedYearVariable</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547365#M482598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share your app sample?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 04:29:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547365#M482598</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-08-01T04:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Calc using SelectedYearVariable</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547366#M482599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi tres qv,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached the sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for taking a look.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 05:30:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547366#M482599</guid>
      <dc:creator />
      <dc:date>2013-08-01T05:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Calc using SelectedYearVariable</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547367#M482600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the max date for the year 2013 available here in your app is 30/06/2013 (Invoice_Period_Field), hence the LYTD is full year data. i suggest you to check the same with some data for a date greater than today(last year). otherwise the behaviour seems OK to me. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 06:02:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547367#M482600</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-08-01T06:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Calc using SelectedYearVariable</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547368#M482601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi tres qv,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response. That's because our fiscal year runs from July 1st to June 30th. So the last day of Fiscal Year 2013 is 30/06/2013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure I understand what you mean when you say, "hence the LYTD is full year data."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to achieve is that if I were to run the refresh today, August 1st, 2013, I want to see data from "FiscalYear to date 2013" as July 1st, 2012 through August 1st, 2012. and I want to see data from "FiscalYear to date 2014" as July 1st 2013 though August 1st 2013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I apologize if I wasn't clear before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 06:12:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547368#M482601</guid>
      <dc:creator />
      <dc:date>2013-08-01T06:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Calc using SelectedYearVariable</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547369#M482602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Fiscal_Year={"$(=vBrokerageSelectedYear-1)"},Fiscal_Year_Earned=,I_Month=,I_Month_Earned=,Invoice_Period_Field={"&amp;lt;=$(=(Addmonths(today(),-12)))"}&amp;gt;}Net_Income)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 07:22:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547369#M482602</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-08-01T07:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Calc using SelectedYearVariable</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547370#M482603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;tres qv,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the reply. That works for the current year, but as I go further back, say 2012 for example, the same problem exists. I need vBrokerageSelectedYear to be the driving force for both the Fiscal_Year half of the expression AND the Invoice_Period_Field of the expression. Any kind of 'today()' I'm afraid won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know how I can incorporate vBrokerageSelectedYear into the Invoice_Period_Field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 22:43:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547370#M482603</guid>
      <dc:creator />
      <dc:date>2013-08-01T22:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Calc using SelectedYearVariable</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547371#M482604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PFA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: If you peek year from today() while deriving last-year-today date in the set analysis, it might not always be same as fiscal year (unless untill converted accordingly) and i believe that was causing the issue in the earlier version of expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2013 06:06:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Calc-using-SelectedYearVariable/m-p/547371#M482604</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-08-02T06:06:24Z</dc:date>
    </item>
  </channel>
</rss>

