<?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 Active Directory accountExpires convert to Date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Active-Directory-accountExpires-convert-to-Date/m-p/392030#M696357</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having issues doing load script to convert LDAP accountExpire value to regular readable date.&amp;nbsp; I tried various things from simple calculation, to round function, to the date function and nothing takes.&amp;nbsp; It converts those that are Expired but when there is an actual date, the load returns dash - for the results. Has anyone done this before and have the scripted code?&amp;nbsp; My code is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;IF &lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;accountExpires&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='9223372036854775807', 'Does Not Expire', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;accountExpires&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='0','Does Not Expire', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;accountExpires&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;'0', &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;accountExpires&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;/864000000000 - 109205)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;accountExpires&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; left(lastLogin,11)/86400-109205 as DLastLogin,&amp;nbsp; &lt;/P&gt;&lt;P&gt;left(lastlogin,11) to get the lastlogin in seconds&lt;/P&gt;&lt;P&gt;/86400 to convert to day&lt;/P&gt;&lt;P&gt;- 109207 : Nb of day between time origins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;Anny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Apr 2013 20:12:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-04-23T20:12:32Z</dc:date>
    <item>
      <title>Active Directory accountExpires convert to Date</title>
      <link>https://community.qlik.com/t5/QlikView/Active-Directory-accountExpires-convert-to-Date/m-p/392030#M696357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having issues doing load script to convert LDAP accountExpire value to regular readable date.&amp;nbsp; I tried various things from simple calculation, to round function, to the date function and nothing takes.&amp;nbsp; It converts those that are Expired but when there is an actual date, the load returns dash - for the results. Has anyone done this before and have the scripted code?&amp;nbsp; My code is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;IF &lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;accountExpires&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='9223372036854775807', 'Does Not Expire', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;accountExpires&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='0','Does Not Expire', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;accountExpires&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;'0', &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;accountExpires&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;/864000000000 - 109205)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;accountExpires&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; left(lastLogin,11)/86400-109205 as DLastLogin,&amp;nbsp; &lt;/P&gt;&lt;P&gt;left(lastlogin,11) to get the lastlogin in seconds&lt;/P&gt;&lt;P&gt;/86400 to convert to day&lt;/P&gt;&lt;P&gt;- 109207 : Nb of day between time origins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;Anny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 20:12:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Active-Directory-accountExpires-convert-to-Date/m-p/392030#M696357</guid>
      <dc:creator />
      <dc:date>2013-04-23T20:12:32Z</dc:date>
    </item>
  </channel>
</rss>

