<?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: Concatenate / Updating the table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Concatenate-Updating-the-table/m-p/2453349#M98166</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/252108"&gt;@RoyBatty&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;As a complement to what has already been helped, see the example below:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Tradução" aria-label="Texto traduzido" data-ved="2ahUKEwi5__m45JKGAxW3uZUCHY2fDBEQ3ewLegQIBRAU"&gt;&lt;SPAN class="Y2IQFc"&gt;// Changing the name of the USER_ID field
[result_updates]:
Load
USER_ID as USER_result,
VALUE
Inline
[
USER_ID, VALUE
1, 20
2, 15,
1.25
];

//================================================ =====================//

// Concatenating records where there is no USER_result in USER_ID
Concatenate([result_updates])
[results]:
Load
*
 where not(Exists('USER_result',USER_ID));
load * Inline [
USER_ID, VALUE
1, 20
2, 15
1.25
3, 10
3, 20
1, 15
];

//================================================ =====================//

// Loading data from result_updates table
Final Table:
Load
if(IsNull(USER_result),USER_ID,USER_result) as ID, // If USER_result field is null, return USER_ID otherwise USER_result
*
Resident [result_updates];

//================================================ =====================//

// Deleting result_updates table
Drop Tables [result_updates];

// excluding fields USER_result,USER_ID
drop fields USER_result,USER_ID from TableFinal;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MatheusC_0-1715884054315.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/166251iFA0A7036AFCCA45C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MatheusC_0-1715884054315.png" alt="MatheusC_0-1715884054315.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MatheusC_1-1715884076868.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/166252iA13BB454E89ED59B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MatheusC_1-1715884076868.png" alt="MatheusC_1-1715884076868.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Regarts, Matheus&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 May 2024 18:28:46 GMT</pubDate>
    <dc:creator>MatheusC</dc:creator>
    <dc:date>2024-05-16T18:28:46Z</dc:date>
    <item>
      <title>Concatenate / Updating the table</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-Updating-the-table/m-p/2453303#M98161</link>
      <description>&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Hi,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;There are two tables:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;[results]:&lt;BR /&gt;Load * Inline&lt;BR /&gt;[&lt;BR /&gt;USER_ID, VALUE&lt;BR /&gt;1, 20&lt;BR /&gt;2, 15&lt;BR /&gt;1, 25&lt;BR /&gt;3, 10&lt;BR /&gt;3, 20&lt;BR /&gt;1, 15&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;[result_updates]:&lt;BR /&gt;Load * Inline&lt;BR /&gt;[&lt;BR /&gt;USER_ID, VALUE&lt;BR /&gt;1, 20&lt;BR /&gt;2, 15,&lt;BR /&gt;1, 25&lt;BR /&gt;];&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;They will be concatenated and the new table will look like this::&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;USER_ID, VALUE&lt;BR /&gt;1, 20&lt;BR /&gt;2, 15&lt;BR /&gt;1, 25&lt;BR /&gt;3, 10&lt;BR /&gt;3, 20&lt;BR /&gt;1, 15&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;1, 20&lt;BR /&gt;2, 15,&lt;BR /&gt;1, 25&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;However, we want to remove records from the first table that have a &lt;STRONG&gt;user_id&lt;/STRONG&gt; for which there are records in the second table.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;So this is the result we want (order doesn't matter):&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;USER_ID, VALUE&lt;BR /&gt;3, 10&lt;BR /&gt;3, 20&lt;BR /&gt;&lt;BR /&gt;1, 20&lt;BR /&gt;2, 15,&lt;BR /&gt;1, 25&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;So, since in the second table (&lt;STRONG&gt;result_updates&lt;/STRONG&gt;) there are records with &lt;STRONG&gt;user_id = 1&lt;/STRONG&gt; and &lt;STRONG&gt;2&lt;/STRONG&gt;, then the records from the first table with &lt;STRONG&gt;user_id = 1&lt;/STRONG&gt; and &lt;STRONG&gt;2&lt;/STRONG&gt; will be removed.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;---------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;We tried the following:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;[result_updates]:&lt;BR /&gt;Load * Inline&lt;BR /&gt;[&lt;BR /&gt;USER_ID, VALUE&lt;BR /&gt;1, 20&lt;BR /&gt;2, 15,&lt;BR /&gt;1, 25&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Concatenate (result_updates)&lt;BR /&gt;Load * Inline&lt;BR /&gt;[&lt;BR /&gt;USER_ID, VALUE&lt;BR /&gt;1, 20&lt;BR /&gt;2, 15&lt;BR /&gt;1, 25&lt;BR /&gt;3, 10&lt;BR /&gt;3, 20&lt;BR /&gt;1, 15&lt;BR /&gt;]&lt;BR /&gt;WHERE NOT EXISTS(USER_ID, USER_ID);&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;but the result is:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RoyBatty_0-1715875432211.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/166239i16762A337384009E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RoyBatty_0-1715875432211.png" alt="RoyBatty_0-1715875432211.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;One record is missing - there is only one record with user id = 3. This is the result we want:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;USER_ID, VALUE&lt;BR /&gt;1, 20&lt;BR /&gt;2, 15,&lt;BR /&gt;1, 25&lt;BR /&gt;&lt;BR /&gt;3, 10&lt;BR /&gt;3, 20&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Do you have any suggestions on how we can achieve this? &lt;SPAN class="lia-unicode-emoji" title=":thinking_face:"&gt;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 16:09:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-Updating-the-table/m-p/2453303#M98161</guid>
      <dc:creator>RoyBatty</dc:creator>
      <dc:date>2024-05-16T16:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate / Updating the table</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-Updating-the-table/m-p/2453337#M98165</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/252108"&gt;@RoyBatty&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Try this code:&lt;/P&gt;
&lt;PRE&gt;[result_updates]:&lt;BR /&gt;Load &lt;BR /&gt;USER_ID,&lt;BR /&gt;VALUE,&lt;BR /&gt;USER_ID AS TEMP_USER_ID&lt;BR /&gt;Inline [&lt;BR /&gt;USER_ID, VALUE&lt;BR /&gt;1, 20&lt;BR /&gt;2, 15,&lt;BR /&gt;1, 25&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Concatenate (result_updates)&lt;BR /&gt;Load * Inline [&lt;BR /&gt;USER_ID, VALUE&lt;BR /&gt;1, 20&lt;BR /&gt;2, 15&lt;BR /&gt;1, 25&lt;BR /&gt;3, 10&lt;BR /&gt;3, 20&lt;BR /&gt;1, 15&lt;BR /&gt;]&lt;BR /&gt;WHERE NOT EXISTS(TEMP_USER_ID, USER_ID)&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;DROP FIELD TEMP_USER_ID;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 17:55:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-Updating-the-table/m-p/2453337#M98165</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2024-05-16T17:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate / Updating the table</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-Updating-the-table/m-p/2453349#M98166</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/252108"&gt;@RoyBatty&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;As a complement to what has already been helped, see the example below:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Tradução" aria-label="Texto traduzido" data-ved="2ahUKEwi5__m45JKGAxW3uZUCHY2fDBEQ3ewLegQIBRAU"&gt;&lt;SPAN class="Y2IQFc"&gt;// Changing the name of the USER_ID field
[result_updates]:
Load
USER_ID as USER_result,
VALUE
Inline
[
USER_ID, VALUE
1, 20
2, 15,
1.25
];

//================================================ =====================//

// Concatenating records where there is no USER_result in USER_ID
Concatenate([result_updates])
[results]:
Load
*
 where not(Exists('USER_result',USER_ID));
load * Inline [
USER_ID, VALUE
1, 20
2, 15
1.25
3, 10
3, 20
1, 15
];

//================================================ =====================//

// Loading data from result_updates table
Final Table:
Load
if(IsNull(USER_result),USER_ID,USER_result) as ID, // If USER_result field is null, return USER_ID otherwise USER_result
*
Resident [result_updates];

//================================================ =====================//

// Deleting result_updates table
Drop Tables [result_updates];

// excluding fields USER_result,USER_ID
drop fields USER_result,USER_ID from TableFinal;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MatheusC_0-1715884054315.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/166251iFA0A7036AFCCA45C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MatheusC_0-1715884054315.png" alt="MatheusC_0-1715884054315.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MatheusC_1-1715884076868.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/166252iA13BB454E89ED59B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MatheusC_1-1715884076868.png" alt="MatheusC_1-1715884076868.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Regarts, Matheus&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 18:28:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-Updating-the-table/m-p/2453349#M98166</guid>
      <dc:creator>MatheusC</dc:creator>
      <dc:date>2024-05-16T18:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate / Updating the table</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-Updating-the-table/m-p/2453402#M98170</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 21:28:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-Updating-the-table/m-p/2453402#M98170</guid>
      <dc:creator>RoyBatty</dc:creator>
      <dc:date>2024-05-16T21:28:30Z</dc:date>
    </item>
  </channel>
</rss>

