<?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: Expression - Concat three variables if not empty/null in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1962602#M1220207</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/63606"&gt;@MrBosch&lt;/a&gt;&amp;nbsp; I not very clear with your requirement, with whatever I have understood I have written a script for you.&lt;/P&gt;
&lt;P&gt;My Script will produce full name only if the all the 3 fields i.e. first, middle and last name are not null else it will produce as null.&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;BR /&gt;Temp:&lt;BR /&gt;Load EmptyIsNull([first name]) as [first name],&lt;BR /&gt;EmptyIsNull([middle name]) as [middle name],&lt;BR /&gt;EmptyIsNull([last name]) as [last name]&lt;/P&gt;
&lt;P&gt;Inline [&lt;BR /&gt;first name,middle name,last name&lt;BR /&gt;John,,Cleese&lt;BR /&gt;Joe, John, Baker&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;BR /&gt;Temp1:&lt;BR /&gt;Load *,&lt;BR /&gt;if(isnull([first name]) or isnull([middle name]) or isnull([last name]), null(),&lt;BR /&gt;[first name]&amp;amp;' '&amp;amp;[middle name]&amp;amp;' '&amp;amp;[last name]) as Name&lt;BR /&gt;Resident Temp;&lt;BR /&gt;Drop table Temp;&lt;/P&gt;
&lt;P&gt;Exit Script;&lt;/P&gt;
&lt;P&gt;Let me know if there is something else that you are looking for.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sidhiq91_0-1659258494083.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/85505i1F4A236A470FF68E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sidhiq91_0-1659258494083.png" alt="sidhiq91_0-1659258494083.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 31 Jul 2022 09:08:51 GMT</pubDate>
    <dc:creator>sidhiq91</dc:creator>
    <dc:date>2022-07-31T09:08:51Z</dc:date>
    <item>
      <title>Expression - Concat three variables if not empty/null</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1962595#M1220205</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;This must be a no-brainer but I am stuck.&lt;/P&gt;
&lt;P&gt;Fields:&amp;nbsp;&lt;BR /&gt;first name&lt;BR /&gt;middle name&lt;BR /&gt;last name&lt;BR /&gt;&lt;BR /&gt;I need to concatenate these three but only if there is a value (for example in the middle name).&lt;/P&gt;
&lt;P&gt;Output:&lt;BR /&gt;John Cleese&lt;BR /&gt;Joe John Baker&lt;/P&gt;
&lt;P&gt;It will be evaluated in a text object on my dashboard containing more rows:&lt;BR /&gt;Full name: John Cleese&lt;BR /&gt;Organisation: Baker Inc&lt;BR /&gt;etc.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2022 08:12:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1962595#M1220205</guid>
      <dc:creator>MrBosch</dc:creator>
      <dc:date>2022-07-31T08:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Expression - Concat three variables if not empty/null</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1962602#M1220207</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/63606"&gt;@MrBosch&lt;/a&gt;&amp;nbsp; I not very clear with your requirement, with whatever I have understood I have written a script for you.&lt;/P&gt;
&lt;P&gt;My Script will produce full name only if the all the 3 fields i.e. first, middle and last name are not null else it will produce as null.&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;BR /&gt;Temp:&lt;BR /&gt;Load EmptyIsNull([first name]) as [first name],&lt;BR /&gt;EmptyIsNull([middle name]) as [middle name],&lt;BR /&gt;EmptyIsNull([last name]) as [last name]&lt;/P&gt;
&lt;P&gt;Inline [&lt;BR /&gt;first name,middle name,last name&lt;BR /&gt;John,,Cleese&lt;BR /&gt;Joe, John, Baker&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;BR /&gt;Temp1:&lt;BR /&gt;Load *,&lt;BR /&gt;if(isnull([first name]) or isnull([middle name]) or isnull([last name]), null(),&lt;BR /&gt;[first name]&amp;amp;' '&amp;amp;[middle name]&amp;amp;' '&amp;amp;[last name]) as Name&lt;BR /&gt;Resident Temp;&lt;BR /&gt;Drop table Temp;&lt;/P&gt;
&lt;P&gt;Exit Script;&lt;/P&gt;
&lt;P&gt;Let me know if there is something else that you are looking for.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sidhiq91_0-1659258494083.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/85505i1F4A236A470FF68E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sidhiq91_0-1659258494083.png" alt="sidhiq91_0-1659258494083.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2022 09:08:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1962602#M1220207</guid>
      <dc:creator>sidhiq91</dc:creator>
      <dc:date>2022-07-31T09:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Expression - Concat three variables if not empty/null</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1962605#M1220208</link>
      <description>&lt;P&gt;Hi and thanks for your quick reply.&lt;/P&gt;
&lt;P&gt;First I tried to avoid the script area. I just wanted to try to get it as an expression to be used in the text object.&lt;/P&gt;
&lt;P&gt;Second when I look at your Temp1 output: the John - Cleese should have been John Cleese in the Name column. Now it is empty.&lt;/P&gt;
&lt;P&gt;To clarify: I only need to glue variable names together. In my own syntax:&lt;/P&gt;
&lt;P&gt;= 'Full name: ' &amp;amp; [first name] &amp;amp; &lt;FONT color="#FF0000"&gt;if(notempty ([middle name], [middle name], else '')&lt;/FONT&gt; &amp;amp; [last name] &amp;amp;chr(10) &amp;amp;&lt;BR /&gt;&lt;SPAN&gt;'Organization: ' &amp;amp; [organization] etc.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2022 10:27:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1962605#M1220208</guid>
      <dc:creator>MrBosch</dc:creator>
      <dc:date>2022-07-31T10:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Expression - Concat three variables if not empty/null</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1962676#M1220215</link>
      <description>&lt;P&gt;I have also same issue any suggestion for this so please reply. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 05:32:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1962676#M1220215</guid>
      <dc:creator>thomas8927eva</dc:creator>
      <dc:date>2022-08-01T05:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Expression - Concat three variables if not empty/null</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1962825#M1220222</link>
      <description>&lt;P&gt;If your fields contain a real NULL you could use coalesce(), like: [First] &amp;amp; coalesce([Middle], '') &amp;amp; [Last] + additionally space and the other wanted information. If it's not NULL you could replace coalesce() with: if(len(trim([Middle])), [Middle], '').&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 11:24:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1962825#M1220222</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-08-01T11:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Expression - Concat three variables if not empty/null</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1963036#M1220232</link>
      <description>&lt;P&gt;Perfect Marcus, works like a charm. Thank you very much.&lt;/P&gt;
&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 20:17:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1963036#M1220232</guid>
      <dc:creator>MrBosch</dc:creator>
      <dc:date>2022-08-01T20:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Expression - Concat three variables if not empty/null</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1963540#M1220252</link>
      <description>&lt;P&gt;And perhaps to add a little extra to make it 100% functional:&lt;/P&gt;
&lt;P&gt;= 'Full name: ' &amp;amp;[&lt;EM&gt;first name&lt;/EM&gt;] &amp;amp;' ' &amp;amp;coalesce([&lt;EM&gt;middle name&lt;/EM&gt;], '') &amp;amp; if(len([&lt;EM&gt;middle name]&lt;/EM&gt;&amp;nbsp;&amp;gt; 0), ' ')&amp;nbsp;&amp;amp;[&lt;EM&gt;last name&lt;/EM&gt;] &amp;amp; Chr(10)&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 16:12:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Concat-three-variables-if-not-empty-null/m-p/1963540#M1220252</guid>
      <dc:creator>MrBosch</dc:creator>
      <dc:date>2022-08-02T16:12:10Z</dc:date>
    </item>
  </channel>
</rss>

