<?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 Trouble converting this case when statement in SQL to qlikview syntax in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trouble-converting-this-case-when-statement-in-SQL-to-qlikview/m-p/216688#M69987</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Can someone help me translate the following case when statement in SQL to a syntaxt that qlikview will understand in the load statement? In the statement below TIME is my date field. YEAR is an nvarchar data type. An example of a value for YEAR is 'F2011'. I can't seem to get this to work in qlikview.&lt;/P&gt;&lt;P&gt;case when TIME in ('Jan','Feb','Mar')&lt;BR /&gt; then convert(smalldatetime,right(YEAR,4)+ TIME)&lt;BR /&gt; else dateadd(month,-12,convert(smalldatetime,right(YEAR,4)+ TIME))&lt;BR /&gt; end as Date&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Apr 2011 18:50:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-14T18:50:28Z</dc:date>
    <item>
      <title>Trouble converting this case when statement in SQL to qlikview syntax</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-converting-this-case-when-statement-in-SQL-to-qlikview/m-p/216688#M69987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Can someone help me translate the following case when statement in SQL to a syntaxt that qlikview will understand in the load statement? In the statement below TIME is my date field. YEAR is an nvarchar data type. An example of a value for YEAR is 'F2011'. I can't seem to get this to work in qlikview.&lt;/P&gt;&lt;P&gt;case when TIME in ('Jan','Feb','Mar')&lt;BR /&gt; then convert(smalldatetime,right(YEAR,4)+ TIME)&lt;BR /&gt; else dateadd(month,-12,convert(smalldatetime,right(YEAR,4)+ TIME))&lt;BR /&gt; end as Date&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 18:50:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-converting-this-case-when-statement-in-SQL-to-qlikview/m-p/216688#M69987</guid>
      <dc:creator />
      <dc:date>2011-04-14T18:50:28Z</dc:date>
    </item>
    <item>
      <title>Trouble converting this case when statement in SQL to qlikview syntax</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-converting-this-case-when-statement-in-SQL-to-qlikview/m-p/216689#M69988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Mike&lt;/P&gt;&lt;P&gt;TIME is a timestamp, right?&lt;/P&gt;&lt;P&gt;it would be something like this, inside a load statement.&lt;/P&gt;&lt;P&gt;LOAD ...&lt;/P&gt;&lt;P&gt;if( num(month(TIME))&amp;lt;3, MAKEDATE( RIGHT(YEAR,4), NUM( MONTH(TIME)) , DAY(TIME)),&lt;/P&gt;&lt;P&gt;ADDMONTHS( MAKEDATE( RIGHT(YEAR,4), NUM( MONTH(TIME)) , DAY(TIME)), -12) AS Date;&lt;/P&gt;&lt;P&gt;select ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tell me if if works for you data&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 02:50:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-converting-this-case-when-statement-in-SQL-to-qlikview/m-p/216689#M69988</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-04-15T02:50:42Z</dc:date>
    </item>
  </channel>
</rss>

