<?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 YTD till current day in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253670#M96132</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi layal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what you want to achieve with that expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Do you really want "max(Year-1)" or "max(Year)-1" ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Then, why do you limit the Month to the min value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jul 2011 13:41:56 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2011-07-04T13:41:56Z</dc:date>
    <item>
      <title>YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253667#M96129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello i'm calculating YTD &lt;/P&gt;&lt;P&gt;i'm using the following in my expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=max(Year)-1)}, Month = {"&amp;lt;=$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;} Month))"}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this expression gives me YTD of lest year till the end of the month.I need to add the day till today.how can i add it in my expression??&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>Mon, 04 Jul 2011 12:21:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253667#M96129</guid>
      <dc:creator />
      <dc:date>2011-07-04T12:21:51Z</dc:date>
    </item>
    <item>
      <title>YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253668#M96130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi layal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assuming you have a "Day" field, try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=max(Year)-1)}, Month = {"&amp;lt;=$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;} Month))"}, Day = {"&amp;lt;=$(=day(today(2)))"}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 13:08:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253668#M96130</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-04T13:08:36Z</dc:date>
    </item>
    <item>
      <title>YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253669#M96131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;with last YTD that's what i did but it's not giving me the result till from beginning of last year till same day as today this year!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=max(Year-1))}, Month = {"&amp;gt;=$(=min({&amp;lt;Year={$(=max(Year-1))}&amp;gt;} Month)+1) &amp;lt;=$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;} Month))"},Day={"&amp;lt;=$(=day(today()))"}&amp;gt;} SalesDetails.CSEXPR - SalesDetails.CSEXVT)/1500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any idea why??!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 13:27:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253669#M96131</guid>
      <dc:creator />
      <dc:date>2011-07-04T13:27:50Z</dc:date>
    </item>
    <item>
      <title>YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253670#M96132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi layal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what you want to achieve with that expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Do you really want "max(Year-1)" or "max(Year)-1" ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Then, why do you limit the Month to the min value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 13:41:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253670#M96132</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-04T13:41:56Z</dc:date>
    </item>
    <item>
      <title>YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253671#M96133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) i need the max of last year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) i'm choosing min to get the minimum month of the year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anyway to make it clear i need to get the Last YTD starting february till current date of today&lt;/P&gt;&lt;P&gt;any idea??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;layal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 13:50:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253671#M96133</guid>
      <dc:creator />
      <dc:date>2011-07-04T13:50:49Z</dc:date>
    </item>
    <item>
      <title>YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253672#M96134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;by the way the following expression is working,it's giving me the right result starting february last year but till the "END" of the same month of this year.and what i need is till the same day not till the same end of month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=max(Year-1))}, Month = {"&amp;gt;=$(=min({&amp;lt;Year={$(=max(Year-1))}&amp;gt;} Month)+1) &amp;lt;=$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;} Month))"}&amp;gt;} SalesDetails.CSEXPR - SalesDetails.CSEXVT)/1500&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 13:56:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253672#M96134</guid>
      <dc:creator />
      <dc:date>2011-07-04T13:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253673#M96135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi layal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to build a small .qvw&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the calculation is correct to the current day last year. Please check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 14:49:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253673#M96135</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-04T14:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253674#M96136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi layal, it's me again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that your expression is depending on current selection (previous year of max. selected year).&lt;/P&gt;&lt;P&gt;If you need a fixed last year as of today (i.e. 2010), you could use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;Year = {$(=year(today())-1)}, Month = {"&amp;gt;=$(=min({&amp;lt;Year={$(=year(today())-1)}&amp;gt;} Month)+1) &amp;lt;=$(=max({&amp;lt;Year={$(=year(today()))}&amp;gt;} Month))"},Day={"&amp;lt;=$(=day(today()))"}&amp;gt;} Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is starting the YTD with last years min month +1 (Februar in this example, but depending on data) a business requirement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 15:59:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253674#M96136</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-04T15:59:29Z</dc:date>
    </item>
    <item>
      <title>YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253675#M96137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i checked your qvw file.i used the same expression as yours but i'm not getting the right result regarding Last YTD.&lt;/P&gt;&lt;P&gt;it's as if it's getting the sum of the sales &amp;lt;=4days of each month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;their year start on february the 1st of each year and not on january that why i'm using min(month + 1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 16:37:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253675#M96137</guid>
      <dc:creator />
      <dc:date>2011-07-04T16:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253676#M96138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi layal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ups, you got me. My expression will limit the evaluation to days of months &amp;lt; current day of months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's absolutely nonsense, of course.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess you have a date field, too. (if not, that could be created during load, see my example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;Year = {$(=year(today())-1)}, Month = {"&amp;gt;=$(=min({&amp;lt;Year={$(=year(today())-1)}&amp;gt;} Month)+1) &amp;lt;=$(=max({&amp;lt;Year={$(=year(today()))}&amp;gt;} Month))"},Date={"&amp;lt;=$(=date(today()))"}&amp;gt;} Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should work, now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for my mistake, I think I need some sleep,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 17:23:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253676#M96138</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-04T17:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253677#M96139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi layal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another comment:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If customer has no data for january of a certain year,data starting in Feb, min(month + 1) would result in March, wouldn't it?&lt;/P&gt;&lt;P&gt;And talking about January, this month will never be taken into account then? (Because you start summing up the values not before February and stop with current month, maximum Dezember)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in month January 2011, does this count to previous year 2010, then?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[I am not sure if I make myself clear, I think I go home now]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 17:30:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253677#M96139</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-04T17:30:27Z</dc:date>
    </item>
    <item>
      <title>YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253678#M96140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the customer always has data in january.&lt;SPAN style="font-size: 10pt;"&gt;in example if today is 04/07/2011 then YTD begins on 01/02/2011 till 04/07/2011 and LYTD begins on 01/02/2010 till 04/07/2010.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;january is going to be the last month of the year not december.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 17:39:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253678#M96140</guid>
      <dc:creator />
      <dc:date>2011-07-04T17:39:12Z</dc:date>
    </item>
    <item>
      <title>YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253679#M96141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for the help Stefan&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as u said it works using the date...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;layal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 18:08:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253679#M96141</guid>
      <dc:creator />
      <dc:date>2011-07-04T18:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: YTD till current day</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253680#M96142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi layal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am glad to help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Being a little refreshed this morning, I think my expression is not absolutely correct:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;Year = {$(=year(today())-1)}, Month = {"&amp;gt;=$(=min({&amp;lt;Year={$(=year(today())-1)}&amp;gt;} Month)+1) &amp;lt;=$(=max({&amp;lt;Year={$(=year(today()))}&amp;gt;} Month))"},Date={"&amp;lt;=$(=date(today()))"}&amp;gt;} Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will calculate the YTD last year, but not till today, but until end of month. In my example, you get 700 for the YTD last year column, but correct is 600 (disregarding the value of 15.7.2010).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think correct ist:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;Year = {$(=year(today())-1)}, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Month = {"&amp;gt;= 2"}, //$(=min({&amp;lt;Year={$(=year(today())-1)}&amp;gt;} Month)+1)"},&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date={"&amp;lt;=$(=date(makedate(year(today())-1,month(today()),day(today()))))"},&lt;/P&gt;&lt;P&gt;&amp;nbsp; Day = &amp;gt;} &lt;/P&gt;&lt;P&gt;&amp;nbsp; Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{I cleared the Day selection and limited Date to dates &amp;lt; same Date last year, not &amp;lt; today, you see the difference?}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But on another side, I still don't think that our calculation in case of january is correct (in case of a January date as today), It will not be taken as last month of a financial year correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I worked out a much better solution (in my opinion) for YTD last year:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({1} if (InYearToDate (Date, today(), -1 , 2),&amp;nbsp; Value))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This uses InYearToDate to determine if a given Date is to be taken into account (third parameter -1 for last year, fourth parameter 2 for financial year starts in February). I used set expression {1] to get all values, disregarding current selection, but you can easily change this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also attached example (where you can also set a date as reporting date in input field to play around or select the max. Date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope my thought were correct and this is of any help, I learned a lot working on your problem &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jul 2011 13:33:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-till-current-day/m-p/253680#M96142</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-05T13:33:39Z</dc:date>
    </item>
  </channel>
</rss>

