<?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: Adding 'Start date' and 'End date' to the calendar dynamically in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356017#M1172680</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this what you're looking for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13398468181019362" jivemacro_uid="_13398468181019362"&gt;&lt;P&gt;load *,&lt;/P&gt;&lt;P&gt;MakeDate((2000+[Year Key]),4,1) as StartDate,&lt;/P&gt;&lt;P&gt;MakeDate(2001+[Year Key],3,31) as EndDate&lt;/P&gt;&lt;P&gt; Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Year Key,Calendar Year,Year&lt;/P&gt;&lt;P&gt;10,2010,F11&lt;/P&gt;&lt;P&gt;11,2011,F12&lt;/P&gt;&lt;P&gt;12,2012,F13&lt;/P&gt;&lt;P&gt;13,2013,F14&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 Jun 2012 11:40:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-06-16T11:40:29Z</dc:date>
    <item>
      <title>Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356015#M1172678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a small problem regarding calendar. I have the following fields in the 'Time' table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="16382" class="jive-image" alt="Capture_qlikview1.PNG" src="https://community.qlik.com/legacyfs/online/16382_Capture_qlikview1.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to add two new columns to the this table in the qlikview script.&lt;/P&gt;&lt;P&gt;They are 'start date' and 'end date'. &lt;/P&gt;&lt;P&gt;'start date' should be the April 1 of the current year and 'end date' should be March 31 of the next year.&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;for the column with year key=10 start date='1-April-2010' and end date='31-March-2011'.&lt;/P&gt;&lt;P&gt;We should not hard code for each column,&lt;/P&gt;&lt;P&gt;Please suggest how we can modify the script to get the desired output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Surendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jun 2012 07:42:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356015#M1172678</guid>
      <dc:creator />
      <dc:date>2012-06-16T07:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356016#M1172679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pls Can any one respond!!&lt;/P&gt;&lt;P&gt;It's a bit urgent!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Surendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jun 2012 10:27:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356016#M1172679</guid>
      <dc:creator />
      <dc:date>2012-06-16T10:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356017#M1172680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this what you're looking for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13398468181019362" jivemacro_uid="_13398468181019362"&gt;&lt;P&gt;load *,&lt;/P&gt;&lt;P&gt;MakeDate((2000+[Year Key]),4,1) as StartDate,&lt;/P&gt;&lt;P&gt;MakeDate(2001+[Year Key],3,31) as EndDate&lt;/P&gt;&lt;P&gt; Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Year Key,Calendar Year,Year&lt;/P&gt;&lt;P&gt;10,2010,F11&lt;/P&gt;&lt;P&gt;11,2011,F12&lt;/P&gt;&lt;P&gt;12,2012,F13&lt;/P&gt;&lt;P&gt;13,2013,F14&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jun 2012 11:40:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356017#M1172680</guid>
      <dc:creator />
      <dc:date>2012-06-16T11:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356018#M1172681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/roberto.postma" id="jive-7758728289470616269127" onmouseout="" onmouseover=""&gt;Roberto Postma&lt;/A&gt; suggest you or &lt;/P&gt;&lt;P&gt;MakeDate([Calendar Year],4,1) as StartDate,&lt;/P&gt;&lt;P&gt; MakeDate(([Calendar Year]+1),4,1)as EndDate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jun 2012 14:37:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356018#M1172681</guid>
      <dc:creator />
      <dc:date>2012-06-16T14:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356019#M1172682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Roberto and Mohammed Own for your help.&lt;/P&gt;&lt;P&gt; Sorry for extending this discussion. I have an issue regarding this.&lt;/P&gt;&lt;P&gt;I have to display a default Year. The default Year is displayed in such a way that today's date is checked to find out under which start date and end date it falls and that year is displayed as default Year. &lt;/P&gt;&lt;P&gt;eg: Today's date is 18/06/2012 and it falls between the range 01/04/2012 to 31/03/2013. Hence the default year to be displayed is F13. &lt;/P&gt;&lt;P&gt;Can you help me regarding the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 07:28:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356019#M1172682</guid>
      <dc:creator />
      <dc:date>2012-06-18T07:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356020#M1172683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Surenda-m,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you have to display that? &lt;/P&gt;&lt;P&gt;You mean in a chart or something? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you post a sample-qvw with an indication where your problem lies? Then lets see how I can help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For me it is now unclear if your issue is still in the load-script, or if you want to have some "initial selection" based on the current year; I hope you can elaborate a bit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 07:33:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356020#M1172683</guid>
      <dc:creator />
      <dc:date>2012-06-18T07:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356021#M1172684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roberto,&lt;/P&gt;&lt;P&gt;I have to display the default year value in a list box. I feel it can be done in the front end. &lt;/P&gt;&lt;P&gt;I am unable to find the upload of qvw option in the discussion page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Surendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 07:49:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356021#M1172684</guid>
      <dc:creator />
      <dc:date>2012-06-18T07:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356022#M1172685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this should be helpful for you then. Could you let me know if that helped?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/thread/27836"&gt;http://community.qlik.com/thread/27836&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 07:51:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356022#M1172685</guid>
      <dc:creator />
      <dc:date>2012-06-18T07:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356023#M1172686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No Roberto. That's not what I was looking for. &lt;/P&gt;&lt;P&gt;Let's consider this example.&lt;/P&gt;&lt;P&gt;Today's date is 18/06/2012 . The default Year that is to be displayed is F13.&lt;/P&gt;&lt;P&gt;If today's date is 01/01/2013 then the default Year that is to be displayed is F13. &lt;/P&gt;&lt;P&gt;I think we have to check under which start date and end date range today's date falls under and we have to display the Year(Financial) accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Surendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 07:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356023#M1172686</guid>
      <dc:creator />
      <dc:date>2012-06-18T07:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356024#M1172687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another try... If that is not what you're looking for, perhaps some of the others can try to help &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Find the attached qvw&lt;/P&gt;&lt;P&gt;- note that when the variable vTestDateToday is set to a new (test)value AND you switch between sheet1 and Main... the (as far as I understand your problem correctly) right selection is set...&lt;/P&gt;&lt;P&gt;- The reason is that I defined (at sheet level) a trigger to do the selection and applied some setAnalysis to figure out which year to take&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what I wonder is:&lt;/P&gt;&lt;P&gt;[1] does it pick the right year for every inputdate that you test with? (if not, what is my misunderstanding)&lt;/P&gt;&lt;P&gt;[2] does this fix your problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 09:01:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356024#M1172687</guid>
      <dc:creator />
      <dc:date>2012-06-18T09:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356025#M1172688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wonderful Roberto!!&lt;/P&gt;&lt;P&gt;Thanks a ton!!&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=only(&lt;BR /&gt;{&lt;BR /&gt;1&amp;lt;&lt;BR /&gt;//StartDate={'&amp;lt;=$(=time(now()))'},&lt;BR /&gt;//EndDate={'&amp;gt;=$(=time(now()))'}&lt;BR /&gt;StartDate={"&amp;lt;=$(=date(today()))"},&lt;BR /&gt;EndDate={"&amp;gt;=$(=date(today()))"}&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;BR /&gt;Year)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's what I was looking for.&lt;/P&gt;&lt;P&gt;Roberto,&lt;/P&gt;&lt;P&gt;Can you let me know when only() function is used!!&lt;/P&gt;&lt;P&gt;might sound a bit silly to you:) &lt;/P&gt;&lt;P&gt;I'm very new to QlikView and i'm in the process of learning Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Surendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 12:16:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356025#M1172688</guid>
      <dc:creator />
      <dc:date>2012-06-18T12:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 'Start date' and 'End date' to the calendar dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356026#M1172689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Surendra-m,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About the only-function:&lt;/P&gt;&lt;P&gt;This is what the reference manual says about it:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;only(expression )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If expression over a number of records, as defined by a group by clause, contains only one numeric value,&lt;/P&gt;&lt;P&gt;that value is returned. Else, NULL is returned.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In my own words&lt;/P&gt;&lt;P&gt;- I use it when the outcome must be exactly one value (if it is more, Null() is returned, which is usually not useful)&lt;/P&gt;&lt;P&gt;- It is an aggregation-function, so you can apply setAnalysis in this function&lt;/P&gt;&lt;P&gt;- I use it for a case like this, where the "logic" is such that when the filters are applied correctly, there is only one record / value to return&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For setAnalysis there are good references online; this one I like most of them; I'll attach it here.&lt;/P&gt;&lt;P&gt;If you would have questions on SetAnalysis, I suggest you open a new topic, since that would be offtopic for this one &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy learning! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 12:24:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-Start-date-and-End-date-to-the-calendar-dynamically/m-p/356026#M1172689</guid>
      <dc:creator />
      <dc:date>2012-06-18T12:24:52Z</dc:date>
    </item>
  </channel>
</rss>

