<?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 using YEARSTART not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232032#M83704</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan's suggestion is a good one, but it might take you too far... using Set Identifier {1} instead of {$} causes ignoring all user selections. Perhaps you still need to respect their selections of other fields - Products, Regions, etc...&lt;/P&gt;&lt;P&gt;What you need to ensure is that any selection of Date-related fields (Year, Month, Quarter, Week) - are ignored. Add the following to your list of Set Modifiers:&lt;/P&gt;&lt;P&gt;Year=, Month=, Week=,&lt;/P&gt;&lt;P&gt;and all the selections of date-related fields will be ignored (if your fields are, indeed, named like these).&lt;/P&gt;&lt;P&gt;As a side comment - another, perhaps easier, way of validating YTD is using the function InYearToDate().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV id="refHTML"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 Jul 2010 16:55:17 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2010-07-24T16:55:17Z</dc:date>
    <item>
      <title>YTD using YEARSTART not working</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232030#M83702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Please can someone tell me what is wrong with my YTD formula?:&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;Type = {'Wine'}, Date = {"&amp;gt;=$(=YEARSTART(MIN(Date)))&amp;lt;=$(=MAX(Date))"} &amp;gt;} Sales )&lt;/P&gt;&lt;P&gt;Whenever I choose a week or month the YEARSTART is ignored and I get the number for sales during the selected period, not YTD.&lt;/P&gt;&lt;P&gt;I know =YEARSTART(MIN(Date)) works because I've tried it in a text box and it always returns 1st Jan of the selected/related year. But for some reason when I put it in a set, it doesn't.&lt;/P&gt;&lt;P&gt;Does anyone have any ideas?&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;APS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 12:59:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232030#M83702</guid>
      <dc:creator />
      <dc:date>2010-07-23T12:59:49Z</dc:date>
    </item>
    <item>
      <title>YTD using YEARSTART not working</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232031#M83703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two suggestions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You are using a $ set. This means that the month selection is applied and then the set expression. Hence current month only. Change the first $ sign to 1 to apply the set expression to the unfiltered data.&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;Perhaps the problem is that the Max function returns a number. You may need to convert it to a date:&lt;/LI&gt;&lt;/UL&gt;&lt;P style="padding-left:60px;"&gt;&amp;lt;=$(=MAX(Date)) .. change to ... &amp;lt;=$(=Date(MAX(Date)))&lt;/P&gt;&lt;P&gt;Hope these help&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jul 2010 20:16:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232031#M83703</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2010-07-23T20:16:57Z</dc:date>
    </item>
    <item>
      <title>YTD using YEARSTART not working</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232032#M83704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan's suggestion is a good one, but it might take you too far... using Set Identifier {1} instead of {$} causes ignoring all user selections. Perhaps you still need to respect their selections of other fields - Products, Regions, etc...&lt;/P&gt;&lt;P&gt;What you need to ensure is that any selection of Date-related fields (Year, Month, Quarter, Week) - are ignored. Add the following to your list of Set Modifiers:&lt;/P&gt;&lt;P&gt;Year=, Month=, Week=,&lt;/P&gt;&lt;P&gt;and all the selections of date-related fields will be ignored (if your fields are, indeed, named like these).&lt;/P&gt;&lt;P&gt;As a side comment - another, perhaps easier, way of validating YTD is using the function InYearToDate().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV id="refHTML"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jul 2010 16:55:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232032#M83704</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-07-24T16:55:17Z</dc:date>
    </item>
    <item>
      <title>YTD using YEARSTART not working</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232033#M83705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response. I've used the method of ignoring the other date dimensions before (as you suggest) and it works although it got very complicated when I tried doing a year offset e.g current YTD vs. previous YTD.&lt;/P&gt;&lt;P&gt;I've not used INYEARTODATE before, perhaps this will be the best solution. Can you assist me in creating the expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jul 2010 10:21:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232033#M83705</guid>
      <dc:creator />
      <dc:date>2010-07-26T10:21:47Z</dc:date>
    </item>
    <item>
      <title>YTD using YEARSTART not working</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232034#M83706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's quite difficult to get it right "on dry", without the actual data... If you could post a sample app, I would try and build the expression for you. Otherwise, please refer to the Help Section.&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jul 2010 22:26:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232034#M83706</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-07-26T22:26:01Z</dc:date>
    </item>
    <item>
      <title>YTD using YEARSTART not working</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232035#M83707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg, thanks for your help.&lt;/P&gt;&lt;P&gt;I will try to understand the InYearToDate and Year2Date functions as this will hopefully provide a "simple" solution to my problem.&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;APS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jul 2010 09:46:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232035#M83707</guid>
      <dc:creator />
      <dc:date>2010-07-27T09:46:36Z</dc:date>
    </item>
    <item>
      <title>YTD using YEARSTART not working</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232036#M83708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should anybody be interested, here's one solution using my original expression to create YTD calculation:&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;Type = {'Wine'}, Date = {"&amp;gt;=$(=YEARSTART(MIN(Date)))&amp;lt;=$(=MAX(Date))"} &amp;gt;} Sales )&lt;/P&gt;&lt;P&gt;And YTD-1:&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;Type = {'Wine'}, Date = {"&amp;gt;=$(=YEARSTART(MIN(ADDYEARS(Date,-1))))&amp;lt;=$(=MAX(ADDYEARS(Date,-1)))"} &amp;gt;} Sales )&lt;/P&gt;&lt;P&gt;In both cases it is necessary to ignore all other date/time selections e.g. month, week, quarter etc (as Oleg states). This should be done in the set.&lt;/P&gt;&lt;P&gt;Hopefuly someone will find this useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jul 2010 10:43:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-using-YEARSTART-not-working/m-p/232036#M83708</guid>
      <dc:creator />
      <dc:date>2010-07-27T10:43:56Z</dc:date>
    </item>
  </channel>
</rss>

