<?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: Date to string in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305838#M827642</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all your responses. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it was the problem that Excel was storing it as numeric (which I hadn't realised!).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution of:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If( Isnum(Field), Date(Field), text(Field)) as &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DateorString&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;works perfectly.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Jun 2017 11:40:32 GMT</pubDate>
    <dc:creator>jessica_webb</dc:creator>
    <dc:date>2017-06-30T11:40:32Z</dc:date>
    <item>
      <title>Date to string in script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305831#M827628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a field in my data which will most often be a date, but will sometimes be a string value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get either value accepted? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I load: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field as DateorString&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the value is (e.g.) 22/05/2017 then QV turns it into 42877&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, if I load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date(Field,&amp;nbsp; 'DD/MM/YYYY') as DateorString&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then whilst 22/05/2017 is shown correctly, any place where the value was actually a string doesn't get shown!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also tried:&lt;/P&gt;&lt;P&gt;Text(Field) as DateorString&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but that still converts the date into a 5-digit value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm only planning on using the date as a string anyway, but it needs to show in its correct format. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305831#M827628</guid>
      <dc:creator>jessica_webb</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Date to string in script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305832#M827630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you have got dates in various formats in the source. If that is the case, best way to convert them to a unified format using below logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Date(&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Alt&lt;/STRONG&gt;&lt;/SPAN&gt;(Field, &lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Date#&lt;/STRONG&gt;&lt;/SPAN&gt;(Field, 'PossibleFormat1'),&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Date#&lt;/STRONG&gt;&lt;/SPAN&gt;(Field, 'PossibleFormat2'), ..., &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Date#&lt;/STRONG&gt;&lt;/SPAN&gt;(Field, 'PossibleFormatN')) as Date&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 09:23:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305832#M827630</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-06-30T09:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date to string in script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305833#M827632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tresesco, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response. &lt;/P&gt;&lt;P&gt;But on the contrary - I don't want them as a unified format! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, the field allows the user (who inputs the data onto a spreadsheet) to define at what point in the year they are submitting data. &lt;/P&gt;&lt;P&gt;I want them to be able to give a date value if they choose, or a string value if they choose - and for it to display exactly as they have input it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So one user might write '22/05/2017' and another user might write '8th Submission'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now, in the 'DateorString' field I would like to display:&lt;/P&gt;&lt;P&gt;22/05/2017&lt;/P&gt;&lt;P&gt;8th Submission&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 09:27:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305833#M827632</guid>
      <dc:creator>jessica_webb</dc:creator>
      <dc:date>2017-06-30T09:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date to string in script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305834#M827634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you load from Excel?&lt;/P&gt;&lt;P&gt;Thus in the underlying program, the date is not a text, but a numeric value and only displayed as text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may try to use the ALT-functionality in reading and converting the dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 09:29:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305834#M827634</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2017-06-30T09:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Date to string in script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305835#M827636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In that case Text(Field) should have worked. Sometimes, source data might just hold the numeric values (for proper date values) and that could led to show you five-digit values as you said. To handle that, you can try like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If( Isnum(Field), Date(Field), text(Field)) as &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DateorString&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 09:36:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305835#M827636</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-06-30T09:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Date to string in script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305836#M827638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;may be you can try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;=if(isnum(Field),date(Field,'DD/MM/YYYY'),&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if(istext(&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;STRONG&gt;Field),text(&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&lt;EM&gt;Field)))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 09:37:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305836#M827638</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-06-30T09:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date to string in script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305837#M827640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jessica,&lt;/P&gt;&lt;P&gt;QV recognises Field as Date Field (Dual)&lt;/P&gt;&lt;P&gt;Text(DateorString) -&amp;gt; 22/05/2017&lt;/P&gt;&lt;P&gt;Num(DateorString) -&amp;gt; 42877&lt;/P&gt;&lt;P&gt;I suggest You LOAD without change ed in Front End use always&amp;nbsp; Text(DateorString)&lt;/P&gt;&lt;P&gt;If field contains '8th Submission' You see 8th Submission.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Antonio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 09:41:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305837#M827640</guid>
      <dc:creator>antoniotiman</dc:creator>
      <dc:date>2017-06-30T09:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Date to string in script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305838#M827642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all your responses. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it was the problem that Excel was storing it as numeric (which I hadn't realised!).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution of:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If( Isnum(Field), Date(Field), text(Field)) as &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DateorString&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;works perfectly.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 11:40:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-to-string-in-script/m-p/1305838#M827642</guid>
      <dc:creator>jessica_webb</dc:creator>
      <dc:date>2017-06-30T11:40:32Z</dc:date>
    </item>
  </channel>
</rss>

