<?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 If date=... in load statement in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/If-date-in-load-statement/m-p/980381#M14201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. I try to write if statement in load part of the script. I have "sale date" in format YYYY-MM-DD hh:mm:ss. I need to add column with value that depends on year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to qlik sense help i've written in load that line:&lt;/P&gt;&lt;P&gt;if(Date("sale date",'YYYY')=2011,'CY','LY') as newfield,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it shows only LY when year is 2011,2010 and in the rest of years there is '-'&lt;/P&gt;&lt;P&gt;so it makes me a little confused what to do with it.&lt;/P&gt;&lt;P&gt;Thanks in advance very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Dec 2015 11:01:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-12-09T11:01:13Z</dc:date>
    <item>
      <title>If date=... in load statement</title>
      <link>https://community.qlik.com/t5/App-Development/If-date-in-load-statement/m-p/980381#M14201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. I try to write if statement in load part of the script. I have "sale date" in format YYYY-MM-DD hh:mm:ss. I need to add column with value that depends on year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to qlik sense help i've written in load that line:&lt;/P&gt;&lt;P&gt;if(Date("sale date",'YYYY')=2011,'CY','LY') as newfield,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it shows only LY when year is 2011,2010 and in the rest of years there is '-'&lt;/P&gt;&lt;P&gt;so it makes me a little confused what to do with it.&lt;/P&gt;&lt;P&gt;Thanks in advance very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Dec 2015 11:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-date-in-load-statement/m-p/980381#M14201</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-09T11:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: If date=... in load statement</title>
      <link>https://community.qlik.com/t5/App-Development/If-date-in-load-statement/m-p/980382#M14202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kamil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( year([sale date]) = 2011 ,'CY','LY') as newfield - assuming that the field is recognised as a date field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;other wise use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( year(date#([sale date],'YYYY-MM-DD')) = 2011,'CY','LY' ) as newfield&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Dec 2015 18:36:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-date-in-load-statement/m-p/980382#M14202</guid>
      <dc:creator>reddy-s</dc:creator>
      <dc:date>2015-12-09T18:36:36Z</dc:date>
    </item>
  </channel>
</rss>

