<?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: New field in script based on date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191027#M884692</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcus, that worked perfectly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best wishes,&lt;/P&gt;&lt;P&gt;Jes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Sep 2016 07:30:38 GMT</pubDate>
    <dc:creator>jessica_webb</dc:creator>
    <dc:date>2016-09-23T07:30:38Z</dc:date>
    <item>
      <title>New field in script based on date</title>
      <link>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191022#M884685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a new field in my script, based on dates in my data file, and a date set as a variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a variable in my script as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set vCut_off_date = 01/09/2015;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Later in the script I load a table with the following values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(Date([Latest date]) &amp;lt; Date($(vCut_off_date)),'1','') as [Date set],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Latest date], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Overall&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\..\SourceData\All_Data\QVDs\Cut offs.qvd]&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(Date([Latest inspection date])&amp;lt; Date($(vOfsted_date)),'1','') as [Date set],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My 'If' statement doesn't give me any values for 'Date set' field. &lt;/P&gt;&lt;P&gt;What I'm trying to do is look at the 'Latest date' column, if it is before 01/09/2015, I would like to give it a value of '1' in the new 'Date set' field. Otherwise, I would like it to be blank/null. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried a few variations of my 'if' statement, but none of them work! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice would be appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Jess&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/New-field-in-script-based-on-date/m-p/1191022#M884685</guid>
      <dc:creator>jessica_webb</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: New field in script based on date</title>
      <link>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191023#M884687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try it with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(Date([Latest date]) &amp;lt; '$(vCut_off_date)',1,0) as [Date set],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 07:14:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191023#M884687</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-09-23T07:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: New field in script based on date</title>
      <link>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191024#M884688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="color: #ff0000;"&gt;LET vCut_off_date = Num(MakeDate(2015, 9, 1));&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt; If([Latest date] &amp;lt; $(vCut_off_date),1,'') as [Date set],&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Latest date],&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Overall&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;[..\..\SourceData\All_Data\QVDs\Cut offs.qvd]&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;(qvd);&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 07:15:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191024#M884688</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-23T07:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: New field in script based on date</title>
      <link>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191025#M884690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change this row (' added around variable)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(Date([Latest date]) &amp;lt; Date('$(vCut_off_date)'),'1','') as [Date set],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if still no success, enter this Expression in a TextBox while seletincg one value of Latest date in a listbox&lt;/P&gt;&lt;P&gt;do it step by step, first the second part Date('$(vCut_off_date)'), then the first part Date([Latest date])&lt;/P&gt;&lt;P&gt;look if Dates are in same Format, and finally Combine both parts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sometimes there are minor erros in Expression. I can correct it in TextBox and when Expression works, I take&lt;/P&gt;&lt;P&gt;the Expression in script etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 07:22:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191025#M884690</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-23T07:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: New field in script based on date</title>
      <link>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191026#M884691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #002060;"&gt;Hi Jesicaa,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #002060;"&gt;Please make sure the format of "&lt;STRONG&gt;&lt;SPAN&gt;Latest date" and &lt;SPAN&gt;$(vCut_off_date)" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;are in same format . eg Both are DD/MM//YYYY format.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #002060;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #002060; font-weight: normal;"&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #002060; font-weight: normal;"&gt;&lt;SPAN&gt;KC&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 07:29:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191026#M884691</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2016-09-23T07:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: New field in script based on date</title>
      <link>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191027#M884692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcus, that worked perfectly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best wishes,&lt;/P&gt;&lt;P&gt;Jes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 07:30:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/New-field-in-script-based-on-date/m-p/1191027#M884692</guid>
      <dc:creator>jessica_webb</dc:creator>
      <dc:date>2016-09-23T07:30:38Z</dc:date>
    </item>
  </channel>
</rss>

