<?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: Do not load a data if an attribute value is already present in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955095#M78766</link>
    <description>&lt;P&gt;I can't do what you told me. The data I gave, is only an example. I have a dozen files, with a hundred attributes with thousands of lines.&lt;/P&gt;
&lt;P&gt;The value attribute could have been filled in very well for both AA89. But I only want to keep the first one that comes to me&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jul 2022 09:05:41 GMT</pubDate>
    <dc:creator>Obsyky</dc:creator>
    <dc:date>2022-07-13T09:05:41Z</dc:date>
    <item>
      <title>Do not load a data if an attribute value is already present</title>
      <link>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955073#M78761</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I have these two files&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%" height="25px"&gt;ID&lt;/TD&gt;
&lt;TD width="50%" height="25px"&gt;VALUE&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="25px"&gt;AA56&lt;/TD&gt;
&lt;TD width="50%" height="25px"&gt;158&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="25px"&gt;AB89&lt;/TD&gt;
&lt;TD width="50%" height="25px"&gt;85&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="25px"&gt;BA51&lt;/TD&gt;
&lt;TD width="50%" height="25px"&gt;89&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%" height="25px"&gt;ID&lt;/TD&gt;
&lt;TD width="50%" height="25px"&gt;VALUE&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="25px"&gt;AA56&lt;/TD&gt;
&lt;TD width="50%" height="25px"&gt;158&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="25px"&gt;AB89&lt;/TD&gt;
&lt;TD width="50%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="25px"&gt;GB89&lt;/TD&gt;
&lt;TD width="50%" height="25px"&gt;1000&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I load both files I get this table :&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;ID&lt;/TD&gt;
&lt;TD width="50%"&gt;VALUE&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;AA56&lt;/TD&gt;
&lt;TD width="50%"&gt;158&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;AB89&lt;/TD&gt;
&lt;TD width="50%"&gt;85&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;AB89&lt;/TD&gt;
&lt;TD width="50%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;BA51&lt;/TD&gt;
&lt;TD width="50%"&gt;89&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;GB89&lt;/TD&gt;
&lt;TD width="50%"&gt;1000&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I would like the second AB89 (the one that has no value), not to be loaded.&lt;/P&gt;
&lt;P&gt;So I use Exists in this way: Where Not Exists(ID)&lt;/P&gt;
&lt;P&gt;Except that it doesn't load any files. What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 08:43:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955073#M78761</guid>
      <dc:creator>Obsyky</dc:creator>
      <dc:date>2022-07-13T08:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Do not load a data if an attribute value is already present</title>
      <link>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955083#M78762</link>
      <description>&lt;P&gt;Hi, maybe use&lt;/P&gt;
&lt;P&gt;WHERE not isnull(VALUE) and len(VALUE)&amp;gt;0&lt;/P&gt;
&lt;P&gt;instead Where Not Exists(ID)&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 08:56:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955083#M78762</guid>
      <dc:creator>justISO</dc:creator>
      <dc:date>2022-07-13T08:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Do not load a data if an attribute value is already present</title>
      <link>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955085#M78763</link>
      <description>&lt;P&gt;Hi, try:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;ID,VALUE&lt;BR /&gt;AA56,158&lt;BR /&gt;AB89,85&lt;BR /&gt;BA51,89&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;ID,VALUE&lt;BR /&gt;AA56,158&lt;BR /&gt;AB89,&lt;BR /&gt;GB89,1000&lt;BR /&gt;]&lt;BR /&gt;WHERE NOT EXISTS(ID);&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 08:57:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955085#M78763</guid>
      <dc:creator>RsQK</dc:creator>
      <dc:date>2022-07-13T08:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Do not load a data if an attribute value is already present</title>
      <link>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955095#M78766</link>
      <description>&lt;P&gt;I can't do what you told me. The data I gave, is only an example. I have a dozen files, with a hundred attributes with thousands of lines.&lt;/P&gt;
&lt;P&gt;The value attribute could have been filled in very well for both AA89. But I only want to keep the first one that comes to me&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 09:05:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955095#M78766</guid>
      <dc:creator>Obsyky</dc:creator>
      <dc:date>2022-07-13T09:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Do not load a data if an attribute value is already present</title>
      <link>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955110#M78767</link>
      <description>&lt;P&gt;That script wasnt meant to be taken as a ready solution, but more of an idea. To achieve what you need, you should use WHERE NOT EXISTS. If you can provide your current script example, i can probably adjust it as needed.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 09:17:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955110#M78767</guid>
      <dc:creator>RsQK</dc:creator>
      <dc:date>2022-07-13T09:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Do not load a data if an attribute value is already present</title>
      <link>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955145#M78770</link>
      <description>&lt;LI-CODE lang="markup"&gt;TABLE:
LOAD Distinct
    "A" AS A,
    "ID" AS ID,
    "C" AS C,
    "D" AS D,
    "E" AS E,
    "F" AS F,
    "G" AS G,
    "H" AS H,
    "I" AS I,
    "J" AS J,
    "K" AS K,
    "L" AS L,
    "M" AS M,
    "N" AS N,
    "O" AS O,
    "P" AS P,
    "Q" AS Q,
    "R" AS R,
    "S" AS S,
    "T" AS T,
    "U" AS U,
    "V" AS V,
    "W" AS W,
    "X" AS X,
    "Y" AS Y,
    "Z" AS Z,
    "AA" AS AA,
    "AB" AS AB,
    "AC" AS AC,
    "AD" AS AD,
    "AE" AS AE,
    "AF" AS AF,
    "AG" AS AG,
    "AH" AS AH,
    "AI" AS AI,
    "AJ" AS AJ,
    "AK" AS AK,
    "AL" AS AL,
FROM [Files_indu_*.xlsm]
(ooxml, embedded labels, header is 4 lines, table is [indu]);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code is very simple. I just load all the files that start with "Files_indu_"&lt;BR /&gt;I don't understand why it doesn't work.&lt;BR /&gt;I tried loading a first file, then after loading the others with Where Not Exists, but it doesn't work either&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 10:05:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955145#M78770</guid>
      <dc:creator>Obsyky</dc:creator>
      <dc:date>2022-07-13T10:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Do not load a data if an attribute value is already present</title>
      <link>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955164#M78771</link>
      <description>&lt;P&gt;Okay, so, I assumed that column "C" = VALUE. I have two excel files in my folder that are identical to your example data. The script:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;//Adjust this for your connection, the rest should work:
SET g_path_data = 'LIB://DATA';

RESULT:
LOAD
0 AS ID
AUTOGENERATE 0;

FOR EACH vFile IN FILELIST('$(g_path_data)/Files_indu_*.xlsx')

CONCATENATE (RESULT)
LOAD
A,
ID,
C, //In my excel files this column represents "VALUE"
D,
"E"
FROM [$(vFile)] (ooxml, embedded labels, table is indu)
WHERE NOT EXISTS(ID);

NEXT;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously, you will need to adjust the columns that are loaded (could aswell do LOAD * if possible).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 10:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Do-not-load-a-data-if-an-attribute-value-is-already-present/m-p/1955164#M78771</guid>
      <dc:creator>RsQK</dc:creator>
      <dc:date>2022-07-13T10:29:12Z</dc:date>
    </item>
  </channel>
</rss>

