<?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 issue with if statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-issue-with-if-statement/m-p/1647456#M593139</link>
    <description>&lt;P&gt;1st thing I would check is if your date field is read as date or not... if not, then you might need to use Date#() for Qlik to understand your date field as a date field. Once you fix this part, the expression can be simplified to this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Date(RangeMax([Issue date], [Voucher Date]), 'DD/MM/YYYY') as [Voucher Date]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2019 12:30:50 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2019-11-15T12:30:50Z</dc:date>
    <item>
      <title>Date issue with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Date-issue-with-if-statement/m-p/1647438#M593137</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for trying to assist with my if statement.&lt;/P&gt;&lt;P&gt;I have an issue where i am using 1 of 2 dates for my imported sales data.&lt;/P&gt;&lt;P&gt;The logic should be use [Issue date] if greater than [Voucher Date] or if [Voucher Date] is blank, as [Voucher Date], else use voucher date.&lt;/P&gt;&lt;P&gt;We are importing daily files, appending to an incrementally loaded qvd and then placing the file in a done folder until a new file is received the next day.&lt;/P&gt;&lt;P&gt;The file is working and updating but the date using the below is using [Issue date], even if the [Voucher Date] is greater.&lt;/P&gt;&lt;P&gt;here is the line of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(([Issue date]&amp;gt;=[Voucher Date] or len([Voucher Date]=0)), Date([Issue date], 'DD/MM/YYYY'),Date([Voucher Date], 'DD/MM/YYYY')) as [Voucher Date],&lt;/P&gt;&lt;P&gt;Please can any of the experts of the qlik world advise why,&lt;/P&gt;&lt;P&gt;If the [Voucher Date] is greater than the [Issue date], that the [Voucher Date] is not being used.&lt;/P&gt;&lt;P&gt;NOTE:&lt;/P&gt;&lt;P&gt;If there is a [Voucher Date] present it will always be greater than [Issue date]&lt;/P&gt;&lt;P&gt;Thank you again for your time and expertise.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:56:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-issue-with-if-statement/m-p/1647438#M593137</guid>
      <dc:creator>davyqliks</dc:creator>
      <dc:date>2024-11-16T01:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Date issue with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Date-issue-with-if-statement/m-p/1647453#M593138</link>
      <description>&lt;P&gt;as you said '&amp;nbsp;&lt;SPAN&gt;If there is a [Voucher Date] present it will always be greater than [Issue date] '&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then Just Use like below&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(( len([Voucher Date]=0)), Date([Issue date], 'DD/MM/YYYY'),Date([Voucher Date], 'DD/MM/YYYY')) as [Voucher Date],&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Still you want use both condition try like below,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(( num([Issue date])&amp;gt;=num([Voucher Date]) or len([Voucher Date]=0)), Date([Issue date], 'DD/MM/YYYY'),Date([Voucher Date], 'DD/MM/YYYY')) as [Voucher Date],&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;use num() function&amp;nbsp; while comparing&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 12:22:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-issue-with-if-statement/m-p/1647453#M593138</guid>
      <dc:creator>mahaveerbiraj</dc:creator>
      <dc:date>2019-11-15T12:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Date issue with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Date-issue-with-if-statement/m-p/1647456#M593139</link>
      <description>&lt;P&gt;1st thing I would check is if your date field is read as date or not... if not, then you might need to use Date#() for Qlik to understand your date field as a date field. Once you fix this part, the expression can be simplified to this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Date(RangeMax([Issue date], [Voucher Date]), 'DD/MM/YYYY') as [Voucher Date]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 12:30:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-issue-with-if-statement/m-p/1647456#M593139</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-11-15T12:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Date issue with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Date-issue-with-if-statement/m-p/1647559#M593140</link>
      <description>&lt;P&gt;Hey Sunny,&lt;/P&gt;&lt;P&gt;You simplified it somewhat!&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp; so much, again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; you nailed it for me.&lt;/P&gt;&lt;P&gt;Much appreciated&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 15:24:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-issue-with-if-statement/m-p/1647559#M593140</guid>
      <dc:creator>davyqliks</dc:creator>
      <dc:date>2019-11-15T15:24:49Z</dc:date>
    </item>
  </channel>
</rss>

