<?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: If then based on data source in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-then-based-on-data-source/m-p/886892#M309190</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A system my company uses was recently upgraded and changed the date format in a particular field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The date used to be: Fri Aug 01 01:58:00 GMT 2014&lt;/P&gt;&lt;P&gt;Now it is: 3/28/2015  3:42:11 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We already have scripting to break down the old date into just the Date and Time fields from the historical files, but I need to create a script to separate the date and time for the date field from the new files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My thinking was: (part of this is now being based off of Sunny’s suggestion, whom I still need to thank for the suggestion.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vFolderXFile = 'FolderX\FileName.xlsx';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vFolderXExist = If(FileSize(vFolderXFile) &amp;gt; 0, -1, 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If($(vFolderXExist),&lt;/P&gt;&lt;P&gt;       (Date(Floor(Timestamp#(CreatedTime-Time#(4,'MM/DD/YYYY'))))),&lt;/P&gt;&lt;P&gt;       (Date(Floor(Timestamp#(replace((Right(Trim(CreatedTime),24)),'GMT ',''),'MMM DD hh:mm:ss YYYY')-0.208333333),'MM/DD/YYYY')))&lt;/P&gt;&lt;P&gt;       as ,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Apr 2015 21:42:11 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-04-22T21:42:11Z</dc:date>
    <item>
      <title>If then based on data source</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-based-on-data-source/m-p/886889#M309187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;I have multiple Excel files which are being loaded from two different folders; we'll call them folder x and folder y&lt;/LI&gt;&lt;LI&gt;The data in folder x is newer than that of folder y&lt;/LI&gt;&lt;LI&gt;I want to write an If statement to say something to the effect of:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If (data came from folder x, (do this...),(Else do this...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible? If so, what syntax would you suggest?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 19:13:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-based-on-data-source/m-p/886889#M309187</guid>
      <dc:creator />
      <dc:date>2015-04-22T19:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: If then based on data source</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-based-on-data-source/m-p/886890#M309188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SET vFolderXFile = 'FolderX\FileName.xlsx';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vFolderXExist = If(FileSize(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;vFolderXFile) &amp;gt; 0, -1, 0);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;SET vFolderYFile = 'FolderY\FileName.xlsx';&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;LET vFolderYExist = If(FileSize(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;vFolderYFile) &amp;gt; 0, -1, 0);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;IF $(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;vFolderXExist&lt;/SPAN&gt;) then&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;ENDIF;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;IF &lt;SPAN style="font-size: 13.3333330154419px;"&gt;$(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;vFolderYExist&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;) then&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;ENDIF;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;HTH&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Best,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 20:29:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-based-on-data-source/m-p/886890#M309188</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-04-22T20:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: If then based on data source</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-based-on-data-source/m-p/886891#M309189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What kind of things are you trying to achieve?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During the load process, you know from which folder you are loading, so do you really need the if-statement? You can just implement those expressions / functions while loading from the specific source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, please try to explain what exactly you are trying to do or achieve so we can give you a more specific answer &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 21:25:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-based-on-data-source/m-p/886891#M309189</guid>
      <dc:creator>oknotsen</dc:creator>
      <dc:date>2015-04-22T21:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: If then based on data source</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-based-on-data-source/m-p/886892#M309190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A system my company uses was recently upgraded and changed the date format in a particular field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The date used to be: Fri Aug 01 01:58:00 GMT 2014&lt;/P&gt;&lt;P&gt;Now it is: 3/28/2015  3:42:11 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We already have scripting to break down the old date into just the Date and Time fields from the historical files, but I need to create a script to separate the date and time for the date field from the new files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My thinking was: (part of this is now being based off of Sunny’s suggestion, whom I still need to thank for the suggestion.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vFolderXFile = 'FolderX\FileName.xlsx';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vFolderXExist = If(FileSize(vFolderXFile) &amp;gt; 0, -1, 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If($(vFolderXExist),&lt;/P&gt;&lt;P&gt;       (Date(Floor(Timestamp#(CreatedTime-Time#(4,'MM/DD/YYYY'))))),&lt;/P&gt;&lt;P&gt;       (Date(Floor(Timestamp#(replace((Right(Trim(CreatedTime),24)),'GMT ',''),'MMM DD hh:mm:ss YYYY')-0.208333333),'MM/DD/YYYY')))&lt;/P&gt;&lt;P&gt;       as ,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 21:42:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-based-on-data-source/m-p/886892#M309190</guid>
      <dc:creator />
      <dc:date>2015-04-22T21:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: If then based on data source</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-based-on-data-source/m-p/886893#M309191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the old system is phased out, than maybe you do not need to keep loading the old files.&lt;/P&gt;&lt;P&gt;Load them once, store them as QVD, and in the future only load that QVD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your load script, load the new source files (while in the process adjusting your date to how Qlik stores it), followed by loading your QVDs which will now automatically concatenate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But maybe I am completely misunderstanding your problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 21:54:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-based-on-data-source/m-p/886893#M309191</guid>
      <dc:creator>oknotsen</dc:creator>
      <dc:date>2015-04-22T21:54:53Z</dc:date>
    </item>
  </channel>
</rss>

