<?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: Data load editor - condition to load a line from another file in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Data-load-editor-condition-to-load-a-line-from-another-file/m-p/1797496#M64474</link>
    <description>&lt;P&gt;Hi, you could get the date of extraction from file 2, store it in a variable and use in the load script condition. Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Load the date of extraction from File 2
Version:
LOAD
    "date of extraction" as update_time
FROM [lib://SMS/File2.xlsx]
(ooxml, embedded labels, table is Sheet1)
Where Len("date of extraction") &amp;gt; 0;

// Store the value to a variabe
Let vUpdateTime = Peek('update_time',0,'Version');

Data:
LOAD
  "Source Name",
  Version,
  // Use the variable for conditioning
  If("Source Name" = 'document A', $(vUpdateTime), "last upload") as  "last upload",
  "Detail"
FROM [lib://SMS/Data Sources versioning.xlsx]
(ooxml, embedded labels, header is 1 lines, table is [Feuil1-1]); 

 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Apr 2021 10:40:06 GMT</pubDate>
    <dc:creator>Quy_Nguyen</dc:creator>
    <dc:date>2021-04-07T10:40:06Z</dc:date>
    <item>
      <title>Data load editor - condition to load a line from another file</title>
      <link>https://community.qlik.com/t5/App-Development/Data-load-editor-condition-to-load-a-line-from-another-file/m-p/1797240#M64453</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a condition in my data editor script to load one specific value from another file if a condition is met.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the context:&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 excel files which contains the data I am interested in loading:&amp;nbsp; "Data Sources versioning" and "File2".&lt;/P&gt;&lt;P&gt;In the data load editor I am uploading the data from the file&amp;nbsp;"Data Sources versioning" with the following script (it works perfectly):&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;"Source Name",&lt;BR /&gt;Version,&lt;BR /&gt;"last upload",&lt;BR /&gt;"Detail"&lt;BR /&gt;FROM [lib://SMS/Data Sources versioning.xlsx]&lt;BR /&gt;(ooxml, embedded labels, header is 1 lines, table is [Feuil1-1]);&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add to this script a condition that would do the following:&lt;/P&gt;&lt;P&gt;if&amp;nbsp;"Source Name"="document A" then&amp;nbsp;"last upload"="date of extraction" from the tab 1 of "File2".&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the tab 2 of the file2 there is only one value under the "date of extraction" field. The File2 changes daily contrary to the "data source versioning" file hence why I would like to create that condition.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible ? If so, what would be the script to realize this action?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 14:28:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-load-editor-condition-to-load-a-line-from-another-file/m-p/1797240#M64453</guid>
      <dc:creator>abonnery</dc:creator>
      <dc:date>2021-04-06T14:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Data load editor - condition to load a line from another file</title>
      <link>https://community.qlik.com/t5/App-Development/Data-load-editor-condition-to-load-a-line-from-another-file/m-p/1797496#M64474</link>
      <description>&lt;P&gt;Hi, you could get the date of extraction from file 2, store it in a variable and use in the load script condition. Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Load the date of extraction from File 2
Version:
LOAD
    "date of extraction" as update_time
FROM [lib://SMS/File2.xlsx]
(ooxml, embedded labels, table is Sheet1)
Where Len("date of extraction") &amp;gt; 0;

// Store the value to a variabe
Let vUpdateTime = Peek('update_time',0,'Version');

Data:
LOAD
  "Source Name",
  Version,
  // Use the variable for conditioning
  If("Source Name" = 'document A', $(vUpdateTime), "last upload") as  "last upload",
  "Detail"
FROM [lib://SMS/Data Sources versioning.xlsx]
(ooxml, embedded labels, header is 1 lines, table is [Feuil1-1]); 

 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 10:40:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-load-editor-condition-to-load-a-line-from-another-file/m-p/1797496#M64474</guid>
      <dc:creator>Quy_Nguyen</dc:creator>
      <dc:date>2021-04-07T10:40:06Z</dc:date>
    </item>
  </channel>
</rss>

