<?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: Reformatting date fields 1 at a time… Must be a better way! in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Reformatting-date-fields-1-at-a-time-Must-be-a-better-way/m-p/1529109#M38044</link>
    <description>&lt;P&gt;Thanks &lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6148" target="_blank"&gt;rwunderlich&lt;/A&gt;&amp;nbsp;for answering my question!&amp;nbsp;Your help is much appreciated.&lt;/P&gt;&lt;P&gt;&lt;A href="https://qlikviewcookbook.com/2016/07/touchless-formatting/" target="_self"&gt;https://qlikviewcookbook.com/2016/07/touchless-formatting/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rob.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/3551iE0F38A0C5784D9E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Rob.PNG" alt="Rob.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jan 2019 16:16:04 GMT</pubDate>
    <dc:creator>wdchristensen</dc:creator>
    <dc:date>2019-01-10T16:16:04Z</dc:date>
    <item>
      <title>Reformatting date fields 1 at a time… Must be a better way!</title>
      <link>https://community.qlik.com/t5/App-Development/Reformatting-date-fields-1-at-a-time-Must-be-a-better-way/m-p/1528538#M37974</link>
      <description>&lt;P&gt;I have several apps that pull data from SQL Server and the dates are returned in the default database format of &lt;FONT color="#3366FF"&gt;YYYY-M-D&lt;/FONT&gt;. I can use the “&lt;FONT color="#3366FF"&gt;SET DateFormat='YYYY-M-D';&lt;/FONT&gt;” at the beginning of the load so the fields are recognized as dates but when I add the field as a filter in the application it displays in default SQL format but I want the &lt;FONT color="#008080"&gt;date&lt;/FONT&gt; to show as&lt;FONT color="#008080"&gt; M/D/YYYY&lt;/FONT&gt;. So I should be able to set the date format at the end of the script to “&lt;FONT color="#3366FF"&gt;SET DateFormat='M/D/YYYY';&lt;/FONT&gt;” and change the default display for the string portion of the date, right? Unfortunately this won’t work. So I load every dataset to a resident table reformat the dates one field at a time. This is time consuming and makes for long scripts that do next to nothing. There has to be a better way. &lt;STRONG&gt;Please teach me a better way!&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DatesInQS_Suck.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/3451i775F8230383C44DB/image-size/large?v=v2&amp;amp;px=999" role="button" title="DatesInQS_Suck.png" alt="DatesInQS_Suck.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;SET DateFormat='YYYY-M-D';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;Test_01:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;LOAD&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;date(today()-1, 'YYYY-M-D') as _Yesterday&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;,date(today(), 'YYYY-M-D') as _Today &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;,date(today()+1, 'YYYY-M-D') as _Tomorrow, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;RecNo() as Num&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;autogenerate 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;SET DateFormat='M/D/YYYY';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;Test_02:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;Noconcatenate&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;Load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;_Today as unformatted_Today&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;,Date(Date#(_Yesterday,'YYYY-M-D'), 'M/D/YYYY') as _Yesterday_01&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;,Date(Date#(_Today,'YYYY-M-D'), 'M/D/YYYY') as _Today_01&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;,Date(Date#(_Tomorrow,'YYYY-M-D'), 'M/D/YYYY') as _Tomorrow_01&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;Resident Test_01;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;Exit Script;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:37:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reformatting-date-fields-1-at-a-time-Must-be-a-better-way/m-p/1528538#M37974</guid>
      <dc:creator>wdchristensen</dc:creator>
      <dc:date>2024-11-16T21:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reformatting date fields 1 at a time… Must be a better way!</title>
      <link>https://community.qlik.com/t5/App-Development/Reformatting-date-fields-1-at-a-time-Must-be-a-better-way/m-p/1529109#M38044</link>
      <description>&lt;P&gt;Thanks &lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6148" target="_blank"&gt;rwunderlich&lt;/A&gt;&amp;nbsp;for answering my question!&amp;nbsp;Your help is much appreciated.&lt;/P&gt;&lt;P&gt;&lt;A href="https://qlikviewcookbook.com/2016/07/touchless-formatting/" target="_self"&gt;https://qlikviewcookbook.com/2016/07/touchless-formatting/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rob.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/3551iE0F38A0C5784D9E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Rob.PNG" alt="Rob.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reformatting-date-fields-1-at-a-time-Must-be-a-better-way/m-p/1529109#M38044</guid>
      <dc:creator>wdchristensen</dc:creator>
      <dc:date>2019-01-10T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reformatting date fields 1 at a time… Must be a better way!</title>
      <link>https://community.qlik.com/t5/App-Development/Reformatting-date-fields-1-at-a-time-Must-be-a-better-way/m-p/1529119#M38048</link>
      <description>&lt;P&gt;Example solution:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RobStyleSolution.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/3553iEB85C4E8957A7139/image-size/large?v=v2&amp;amp;px=999" role="button" title="RobStyleSolution.png" alt="RobStyleSolution.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;SET DateFormat='YYYY-M-D';&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;FormatTemplate_01:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;LOAD&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;date(0, 'M/D/YYYY') as _Yesterday&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;,date(0, 'M/D/YYYY') as _Today &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;,date(0, 'M/D/YYYY') as _Tomorrow&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;autogenerate 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;Test_01:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;LOAD&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;today() as DefaultFormatForToday&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;,Num(today()) as NumFormatForToday&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;,today()-1 as _Yesterday&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;,Num(today()) as _Today &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;,date(today()+1, 'YYYY-M-D') as _Tomorrow &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;,RecNo() as Num&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;autogenerate 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;DROP Table FormatTemplate_01;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7" color="#999999"&gt;Exit Script;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 15:52:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reformatting-date-fields-1-at-a-time-Must-be-a-better-way/m-p/1529119#M38048</guid>
      <dc:creator>wdchristensen</dc:creator>
      <dc:date>2019-01-10T15:52:32Z</dc:date>
    </item>
  </channel>
</rss>

