<?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 Date format in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133019#M92077</link>
    <description>&lt;P&gt;how to achieve date format as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;let vcurrentyear = year(Today());&lt;/P&gt;
&lt;P&gt;let vr = '07/01/(vcurrentyear)' ;&lt;/P&gt;
&lt;P&gt;where we want to make&amp;nbsp;vcurrentyear dynamic .&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 21:17:22 GMT</pubDate>
    <dc:creator>ritumishra01</dc:creator>
    <dc:date>2024-11-15T21:17:22Z</dc:date>
    <item>
      <title>Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133019#M92077</link>
      <description>&lt;P&gt;how to achieve date format as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;let vcurrentyear = year(Today());&lt;/P&gt;
&lt;P&gt;let vr = '07/01/(vcurrentyear)' ;&lt;/P&gt;
&lt;P&gt;where we want to make&amp;nbsp;vcurrentyear dynamic .&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:17:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133019#M92077</guid>
      <dc:creator>ritumishra01</dc:creator>
      <dc:date>2024-11-15T21:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133027#M92079</link>
      <description>&lt;P&gt;If I understand your question correctly, then by using&amp;nbsp;&lt;STRONG&gt;makedate()&lt;/STRONG&gt; function.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense/August2023/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunctions/makedate.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/sense/August2023/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunctions/makedate.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Let vr = makedate($(vcurrentyear), 07, 01);&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 17:17:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133027#M92079</guid>
      <dc:creator>HeshamKhja1</dc:creator>
      <dc:date>2023-10-30T17:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133376#M92107</link>
      <description>&lt;P&gt;Did it work for you&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/193501"&gt;@ritumishra01&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 13:35:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133376#M92107</guid>
      <dc:creator>HeshamKhja1</dc:creator>
      <dc:date>2023-10-31T13:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133378#M92108</link>
      <description>let vcurrentyear = Year(Today()); // This variable will hold the current year&lt;BR /&gt;&lt;BR /&gt;let vr = Date#('07/01/' &amp;amp; vcurrentyear, 'MM/DD/YYYY'); // Use Date# to format the date</description>
      <pubDate>Tue, 31 Oct 2023 13:45:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133378#M92108</guid>
      <dc:creator>Aasir</dc:creator>
      <dc:date>2023-10-31T13:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133442#M92113</link>
      <description>&lt;P&gt;I am trying to compare two dates&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if(date($(vcurrentdate)) &amp;gt;= date($(vStartCheck))) then &lt;BR /&gt;let vStart1 = date#('07/01/$(vcurrentyear)','MM/DD/YYYY') else&lt;/P&gt;
&lt;P&gt;here else statement is not working&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 15:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133442#M92113</guid>
      <dc:creator>ritumishra01</dc:creator>
      <dc:date>2023-10-31T15:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133589#M92127</link>
      <description>&lt;DIV&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Code below works fine with me. But this is the control statements IF (Outside the LOAD).&amp;nbsp;&lt;A title="Control Statements" href="https://help.qlik.com/en-US/sense/August2023/Subsystems/Hub/Content/Sense_Hub/ChartLevelScripting/modifier-control-statements.htm#:~:text=Control%20statements%20are%20typically%20used,never%20applied%20to%20control%20statements." target="_blank" rel="noopener"&gt;Qlik Help&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let vStartCheck = '6/1/2023';
let vcurrentyear = year(Today());
let vcurrentdate = '07/01/$(vcurrentyear)'; //MakeDate($(vcurrentyear), 07, 01)

Trace vcurrentyear: $(vcurrentyear);
Trace vcurrentdate: $(vcurrentdate);

If date($(vcurrentdate)) &amp;gt;= date($(vStartCheck)) THEN
   let vStart1 = date#('07/01/$(vcurrentyear)','MM/DD/YYYY');
ELSE
   let vStart1 = 'Tomato';
END IF

Trace vStart1: $(vStart1);&lt;/LI-CODE&gt;
&lt;P&gt;Now if you want the if statement to be inside the LOAD (&lt;A title="If function" href="https://help.qlik.com/en-US/sense/August2023/Subsystems/Hub/Content/Sense_Hub/Scripting/ConditionalFunctions/if.htm" target="_blank" rel="noopener"&gt;Qlik Help&lt;/A&gt;), this is the syntax:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;If(A = B, &amp;lt;Do if True&amp;gt;, &amp;lt;Do if False&amp;gt;)&lt;/LI-CODE&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 01 Nov 2023 06:31:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133589#M92127</guid>
      <dc:creator>HeshamKhja1</dc:creator>
      <dc:date>2023-11-01T06:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133682#M92135</link>
      <description>&lt;P&gt;Hey Hesham, thanks for your response.&lt;/P&gt;
&lt;P&gt;i am using the below query .and i could not achieve what is needed.&lt;/P&gt;
&lt;P&gt;IF-ELSE is not working as expected.&lt;/P&gt;
&lt;P&gt;what we are looking for is this that vstart should be&amp;nbsp;'7/1/2023 00:00' and vENd should be&amp;nbsp;'6/30/2024 23:5923:59';&lt;/P&gt;
&lt;P&gt;and as soon as&amp;nbsp;'6/30/2024 23:5923:59'; date reaches .Vstart should become&amp;nbsp;7/1/2024 00:00'&amp;nbsp; and Vend should be &amp;nbsp;'6/30/2025 23:5923:59';.&lt;/P&gt;
&lt;P&gt;Any help will be much apriciated .&lt;/P&gt;
&lt;P&gt;let vcurrentyear = year(Today());&lt;BR /&gt;let vcurrentyear_1 = (year(today())+1);&lt;BR /&gt;let vcurrentyear_2 = (year(today())+2);&lt;BR /&gt;let vcurrentdate = date(today(),'MM/DD/YYYY');&lt;BR /&gt;let vStartC = num(date#(MakeDate($(vcurrentyear), 07,01),'MM/DD/YYYY'));&lt;BR /&gt;let vEndC =num(date(MakeDate($(vcurrentyear_1),06, 30),'MM/DD/YYYY'));&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;IF(NUM($(vcurrentdate)) &amp;gt; NUM($(vStartC)))&lt;/P&gt;
&lt;P&gt;THEN &lt;BR /&gt;let vStart = date#('07/01/$(vcurrentyear)','MM/DD/YYYY') ; &lt;BR /&gt;let vEnd = date#('06/30/$(vcurrentyear_1)','MM/DD/YYYY');&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;ELSE &lt;BR /&gt;let vStart = date#('07/01/$(vcurrentyear_1)','MM/DD/YYYY');&lt;BR /&gt;let vEnd = date#('06/30/$(vcurrentyear_2)','MM/DD/YYYY');&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;END IF &lt;BR /&gt;;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 11:02:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133682#M92135</guid>
      <dc:creator>ritumishra01</dc:creator>
      <dc:date>2023-11-01T11:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133761#M92137</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/193501"&gt;@ritumishra01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Your scenario is a bit tricky, as it needs initial declaration, and then continue with the logic.&lt;/P&gt;
&lt;P&gt;Code below sets the variable of their initial value and then checks the condition. After running the script for the first time, the variables are defined and saved in the app. Then, you have to comment the first two lines so the variables are not overwritten with the initial values again.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;// Two variables below are to be commented after first load.
Let vstart = '2020-07-01 00:00:00.000';
Let vENd = '2021-06-30 00:00:00.000';

// Let vNow = Now();
Let vNow = '2021-08-05 14:57:24.000'; //Defining my own Now just to test code

If vNow &amp;gt;= vENd THEN

	LET vstart = AddYears('$(vstart)', 1);
	LET vENd = AddYears('$(vENd)', 1);

END IF

Trace vstart: $(vstart);
Trace vENd: $(vENd);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check it and let me know if it works.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 13:41:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133761#M92137</guid>
      <dc:creator>HeshamKhja1</dc:creator>
      <dc:date>2023-11-01T13:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133766#M92138</link>
      <description>&lt;P&gt;how will this set vStart and Vend every year ?dynamic loading ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 13:50:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133766#M92138</guid>
      <dc:creator>ritumishra01</dc:creator>
      <dc:date>2023-11-01T13:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133784#M92140</link>
      <description>&lt;P&gt;Did you try to run the code and change the vNow value? If you do so you will see that&amp;nbsp;&lt;SPAN&gt;vStart and Vend are changing dynamically. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When you want to deploy the app, make variable vNow = Now() and schedule the task in QMC as per your preference.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 14:23:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133784#M92140</guid>
      <dc:creator>HeshamKhja1</dc:creator>
      <dc:date>2023-11-01T14:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133796#M92144</link>
      <description>&lt;P&gt;What if i dont run this code :-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;// Two variables below are to be commented after first load.
Let vstart = '2020-07-01 00:00:00.000';
Let vENd = '2021-06-30 00:00:00.000';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as it already had vstart and vend in the already existing code logic .&lt;/P&gt;
&lt;P&gt;also i have doubt&amp;nbsp; about storing the data every cycle data is being stored like ENC_24 and for next year we have to manually go and change it to&amp;nbsp;ENC_24 and same for vstart and vend can we also automate so that each cycle it stores data in different folders and then in main app we can&amp;nbsp; all data at once&lt;/P&gt;
&lt;P&gt;STORE enc4 INTO [lib://authenticateddata/wbhi/Enc_fy24.QVD] (qvd);&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 15:00:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133796#M92144</guid>
      <dc:creator>ritumishra01</dc:creator>
      <dc:date>2023-11-01T15:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133985#M92155</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/193501"&gt;@ritumishra01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The concept of the code is that you need an initial declaration of the entity storing the dates, and then a mechanism to update the dates yearly. If you already have initial declaration, then yes you can load the old file and then store the changed data into a new file.&lt;/P&gt;
&lt;P&gt;In summary,&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;You need to schedule the app to run yearly (or at your preferred time interval)&lt;/LI&gt;
&lt;LI&gt;The app will load the old file, check the same if condition of Now() &amp;gt;= vend (If you know all data will change to certain date at the time of scheduled load, then maybe there is no need for the if condition).&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Store table into the new path. (You can store to a new file name or/and folder name)&lt;BR /&gt;&lt;/SPAN&gt;&lt;LI-CODE lang="markup"&gt;vYear = Year(Today());
vYY = Right('$(vYear)', 2);
STORE enc4 INTO [lib://authenticateddata\wbhi_$(vYear)\Enc_fy_$(vYY).qvd](qvd);​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 08:27:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2133985#M92155</guid>
      <dc:creator>HeshamKhja1</dc:creator>
      <dc:date>2023-11-07T08:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.qlik.com/t5/App-Development/Date-format/m-p/2134981#M92241</link>
      <description>&lt;P&gt;Hey thanks for your reponse&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;vYY = Right('$(vYear)', 2);
STORE enc4 INTO [lib://authenticateddata\wbhi_$(vYear)&amp;gt;\Enc_fy_$(vYY)&amp;gt;.qvd](qvd);​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;wbhi_$(vYear) - i am getting error here its saying path not found. and how we can include date there ??? thanks&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 14:14:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-format/m-p/2134981#M92241</guid>
      <dc:creator>ritumishra01</dc:creator>
      <dc:date>2023-11-06T14:14:29Z</dc:date>
    </item>
  </channel>
</rss>

