<?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# takes 1-2 parameters error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585689#M739202</link>
    <description>&lt;P&gt;It seems that your date#() conversion failed and then returned date() NULL. Try it with:&lt;/P&gt;&lt;P&gt;if(&lt;STRONG&gt;isnum(&lt;/STRONG&gt;Date#(Left(DateField, 10), 'YYYY-MM-DD')&lt;STRONG&gt;)&lt;/STRONG&gt;=0, 'N/A',&lt;BR /&gt;if(Date(Date#(Left(DateField, 10)&lt;STRONG&gt;, 'YYYY-MM-DD')&lt;/STRONG&gt;&amp;lt;= date(today(),'DD/MM/YYYY')-15,'Not Reporting',&lt;BR /&gt;'Control Met')) AS DateFieldOLD,&lt;/P&gt;&lt;P&gt;whereby I think it would be better to transform (and if it's a timestamp to split into a date- and a time-field) the field at least one step before to simplify all the following matches/calculations.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2019 14:48:31 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2019-05-28T14:48:31Z</dc:date>
    <item>
      <title>Date# takes 1-2 parameters error</title>
      <link>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585657#M739199</link>
      <description>&lt;P&gt;I am getting the above error for the below script and I have no idea why. The IF statement worked before I added the date part and the date part works out of the IF statement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(Date(Date#(Left(DateField, 10), 'YYYY-MM-DD'), 'DD/MM/YYYY')=0, 'N/A',&lt;BR /&gt;if(Date(Date#(Left(DateField, 10)&amp;lt;= date(today(),'DD/MM/YYYY')-15,'Not Reporting',&lt;BR /&gt;'Control Met')) AS DateFieldOLD,&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:27:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585657#M739199</guid>
      <dc:creator>khaycock</dc:creator>
      <dc:date>2024-11-16T03:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date# takes 1-2 parameters error</title>
      <link>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585667#M739200</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;if(Date(Date#(Left(DateField, 10), 'YYYY-MM-DD'), 'DD/MM/YYYY')=0, 'N/A',&lt;BR /&gt;if(Date(Date#(Left(DateField, 10)&lt;STRONG&gt;, 'YYYY-MM-DD')&lt;/STRONG&gt;&amp;lt;= date(today(),'DD/MM/YYYY')-15,'Not Reporting',&lt;BR /&gt;'Control Met')) AS DateFieldOLD,&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 14:06:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585667#M739200</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-05-28T14:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Date# takes 1-2 parameters error</title>
      <link>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585670#M739201</link>
      <description>&lt;P&gt;That solves the second issue, I'm still getting an error on the first IF statement &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 14:12:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585670#M739201</guid>
      <dc:creator>khaycock</dc:creator>
      <dc:date>2019-05-28T14:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Date# takes 1-2 parameters error</title>
      <link>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585689#M739202</link>
      <description>&lt;P&gt;It seems that your date#() conversion failed and then returned date() NULL. Try it with:&lt;/P&gt;&lt;P&gt;if(&lt;STRONG&gt;isnum(&lt;/STRONG&gt;Date#(Left(DateField, 10), 'YYYY-MM-DD')&lt;STRONG&gt;)&lt;/STRONG&gt;=0, 'N/A',&lt;BR /&gt;if(Date(Date#(Left(DateField, 10)&lt;STRONG&gt;, 'YYYY-MM-DD')&lt;/STRONG&gt;&amp;lt;= date(today(),'DD/MM/YYYY')-15,'Not Reporting',&lt;BR /&gt;'Control Met')) AS DateFieldOLD,&lt;/P&gt;&lt;P&gt;whereby I think it would be better to transform (and if it's a timestamp to split into a date- and a time-field) the field at least one step before to simplify all the following matches/calculations.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 14:48:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585689#M739202</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-05-28T14:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date# takes 1-2 parameters error</title>
      <link>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585705#M739203</link>
      <description>&lt;P&gt;Unfortunately I have the same error with this one, however the error is now saying that Date takes 1-2 parameters rather than Date#..&lt;/P&gt;&lt;P&gt;I do transform it beforehand but it all gets a bit complicated as there is a lot going on. This is what I had initially and it worked:&lt;/P&gt;&lt;P&gt;date(floor(date#(Control,'YYYY-MM-DD hh:mm:ssZ')),'DD/MM/YYYY') AS ControlDate,&lt;BR /&gt;IF(len(trim(date(floor(date#(Control,'YYYY-MM-DD hh:mm:ssZ')),'DD/MM/YYYY')))=0,'N/A',&lt;BR /&gt;if(date(floor(date#(ControlTenable,'YYYY-MM-DD hh:mm:ssZ')),'DD/MM/YYYY')&amp;lt;= date(today(),'DD/MM/YYYY')-15,'Not Reporting', 'Control Met')) AS ReportingOLD,&lt;/P&gt;&lt;P&gt;However, the date format randomly changed to 'YYYY-MM-DDThh:mm:ss' and I can't get the above to work with that so I tried the Left instead.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you there is an easier way to get the format to amend to DD/MM/YYYY rather than the left I guess that might work better?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:11:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585705#M739203</guid>
      <dc:creator>khaycock</dc:creator>
      <dc:date>2019-05-28T15:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date# takes 1-2 parameters error</title>
      <link>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585711#M739204</link>
      <description>&lt;P&gt;I think the Z within date#(Control,'YYYY-MM-DD hh:mm:ssZ') won't be interpreted like you want. If it's really there I think I would remove it with replace() or maybe a keepchar/purgechar(). Beside this if there are multiple formattings you could use alt() for it, maybe with something like this:&lt;/P&gt;&lt;P&gt;alt(&lt;STRONG&gt;timestamp#(purgechar(&lt;/STRONG&gt;Control, 'Z'),'YYYY-MM-DD hh:mm:ss'),&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timestamp#(Control,'YYYY/MM/DD hh:mm:ss'), 'no date available')&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:21:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585711#M739204</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-05-28T15:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Date# takes 1-2 parameters error</title>
      <link>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585716#M739205</link>
      <description>&lt;P&gt;Can I use the replace function but also amend the date format to be DD-MM-YYYY?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:31:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585716#M739205</guid>
      <dc:creator>khaycock</dc:creator>
      <dc:date>2019-05-28T15:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Date# takes 1-2 parameters error</title>
      <link>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585915#M739206</link>
      <description>&lt;P&gt;Not within the formatting-functions date() but in the converting-functions like date&lt;STRONG&gt;#&lt;/STRONG&gt;().&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 06:24:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585915#M739206</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-05-29T06:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Date# takes 1-2 parameters error</title>
      <link>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585973#M739207</link>
      <description>&lt;P&gt;I think what I don't understand is why it worked fine when there was a random Z in the date like this:&lt;/P&gt;&lt;P&gt;date(floor(date#(Control,'YYYY-MM-DD hh:mm:ssZ')),'DD/MM/YYYY') AS ControlDate,&lt;/P&gt;&lt;P&gt;But doesn't work when there is a random T in the middle like this:&lt;/P&gt;&lt;P&gt;date(floor(date#(Control,'YYYY-MM-DDThh:mm:ss')),'DD/MM/YYYY') AS ControlDate,&lt;/P&gt;&lt;P&gt;Does it just throw it off track because it can't separate between the date and the time?&lt;/P&gt;&lt;P&gt;It's annoying because I have many controls that all have the Z date and only one with the T date and I don't want to change the logic for all &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 08:12:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-takes-1-2-parameters-error/m-p/1585973#M739207</guid>
      <dc:creator>khaycock</dc:creator>
      <dc:date>2019-05-29T08:12:06Z</dc:date>
    </item>
  </channel>
</rss>

