<?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: Concatenating two fields, separated by a decimal point (period) in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Concatenating-two-fields-separated-by-a-decimal-point-period/m-p/1798093#M8763</link>
    <description>&lt;P&gt;You are bumping up against the limits of numeric precision in floating point numbers.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Rounding-Errors/ba-p/1468808" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Rounding-Errors/ba-p/1468808&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In your case,&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;272587940.20210404210748 = 272587940.20210405120059&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;which is not what you want.&amp;nbsp;&lt;/SPAN&gt;The correct solution for your requirement is to treat these as text() values.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;</description>
    <pubDate>Thu, 08 Apr 2021 17:06:24 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2021-04-08T17:06:24Z</dc:date>
    <item>
      <title>Concatenating two fields, separated by a decimal point (period)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Concatenating-two-fields-separated-by-a-decimal-point-period/m-p/1797794#M8760</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using Qlik Sense Server Feb 2020.&lt;/P&gt;&lt;P&gt;I have a data set for which I need to generate a key to match another data set. This key should consist of two strings of numbers concatenated together into a text string, separated by a period.&lt;/P&gt;&lt;P&gt;So, if string 1 = '12345' and string2&amp;nbsp; = '6789', then key should be '12345.6789'&lt;/P&gt;&lt;P&gt;This inline data is a very simplified version of the actual data set, which is much larger and comes from an SQL query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Load
string1 &amp;amp; '.' &amp;amp; string2 as keyA,
string1 &amp;amp; '|' &amp;amp; string2 as keyB,
string2 &amp;amp; '.' &amp;amp; string1 as keyC, 

*;

Load * inline [
string1, string2
272587940, 2021040421074800
272587940, 2021040512005900
272587940, 2021040516282100
272587940, 2021040517541500
272587940, 2021040518032700
272587940, 2021040523321500
272587940, 2021040605040600
272587940, 2021040606043100
272587940, 2021040611331100
272587940, 2021040611441800
272587940, 2021040616335900
272587940, 2021040616423900
272587940, 2021040700314300
272587940, 2021040700371100
272587940, 2021040710261600
272587940, 2021040710315000
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the resulting data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="awwitas_0-1617829127597.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52609i99D632FB6FDB66C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="awwitas_0-1617829127597.png" alt="awwitas_0-1617829127597.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What's going on here? I would expect keyA to be a simple concatenation of string1 and string2 but it clearly is not.&lt;/P&gt;&lt;P&gt;Some observations:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I can see that keyA is being interpreted as a number... but why isn't it a&amp;nbsp;&lt;EM&gt;unique&lt;/EM&gt; number for each row?&lt;/LI&gt;&lt;LI&gt;Making String1 much longer results in unique text strings in keyA&lt;/LI&gt;&lt;LI&gt;Making String2 shorter results in unique text strings in keyA&lt;/LI&gt;&lt;LI&gt;Loading the pre-concatenated string&amp;nbsp; inline (like&amp;nbsp;&lt;FONT face="courier new,courier"&gt;272587940.2021040421074800&lt;/FONT&gt;) gives the same result as KeyA above&lt;/LI&gt;&lt;LI&gt;Loading the pre-concatenated string&amp;nbsp; inline as a string (like&lt;FONT face="courier new,courier"&gt; '272587940.2021040421074800')&lt;/FONT&gt; gives the same result as KeyA above&lt;/LI&gt;&lt;LI&gt;using &lt;FONT face="courier new,courier"&gt;text(string1 &amp;amp; '.' &amp;amp; string2) as keyA&lt;/FONT&gt; results in a 'correct' result for keyA&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a workaround I can use to make this function (ie pull the concatenated string in SQL as a temporary field and wrap in a text() function using a pre-load statement) but I would really like to know what is happening that makes Qlik give this result.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 21:21:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Concatenating-two-fields-separated-by-a-decimal-point-period/m-p/1797794#M8760</guid>
      <dc:creator>awwitas</dc:creator>
      <dc:date>2021-04-07T21:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating two fields, separated by a decimal point (period)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Concatenating-two-fields-separated-by-a-decimal-point-period/m-p/1798093#M8763</link>
      <description>&lt;P&gt;You are bumping up against the limits of numeric precision in floating point numbers.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Rounding-Errors/ba-p/1468808" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Rounding-Errors/ba-p/1468808&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In your case,&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;272587940.20210404210748 = 272587940.20210405120059&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;which is not what you want.&amp;nbsp;&lt;/SPAN&gt;The correct solution for your requirement is to treat these as text() values.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 17:06:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Concatenating-two-fields-separated-by-a-decimal-point-period/m-p/1798093#M8763</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2021-04-08T17:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating two fields, separated by a decimal point (period)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Concatenating-two-fields-separated-by-a-decimal-point-period/m-p/1798097#M8764</link>
      <description>&lt;P&gt;Ahh, I think I understand. This is a result of floating point precision, combined with the dual nature of Qlik data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Taking these two rows as an example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;a) 272587940, 2021040421074800
b) 272587940, 2021040512005900&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Row a) will result in a concatenated value that is displayed as&amp;nbsp;272587940.2021040421074800, but the internal, rounded value that Qlik uses does not truly have that level of precision&lt;/P&gt;&lt;P&gt;Row b) will result in a concatenated value whose internal, rounded value is the same as row a), so Qlik displays it using the same visual representation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Neither&lt;/EM&gt;&amp;nbsp;row a) or row b)'s concatenated number is &lt;I&gt;actually&amp;nbsp;&lt;/I&gt;equal to&amp;nbsp;272587940.2021040421074800 - that just happens to be the string representation assigned to that number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, that's very helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 17:27:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Concatenating-two-fields-separated-by-a-decimal-point-period/m-p/1798097#M8764</guid>
      <dc:creator>awwitas</dc:creator>
      <dc:date>2021-04-08T17:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating two fields, separated by a decimal point (period)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Concatenating-two-fields-separated-by-a-decimal-point-period/m-p/1798106#M8765</link>
      <description>&lt;P&gt;You stated that very well.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 18:35:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Concatenating-two-fields-separated-by-a-decimal-point-period/m-p/1798106#M8765</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2021-04-08T18:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating two fields, separated by a decimal point (period)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Concatenating-two-fields-separated-by-a-decimal-point-period/m-p/1798113#M8766</link>
      <description>&lt;P&gt;You can deduce this from the above, but I thought it should be stated explicitly for&amp;nbsp;completeness and for anyone stumbling across this post in the future...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When two values in Qlik have the same&amp;nbsp;&lt;EM&gt;numeric representation,&amp;nbsp;&lt;/EM&gt;Qlik will assign them &lt;U&gt;all&lt;/U&gt; the string representation of&amp;nbsp;&lt;EM&gt;the first loaded value&lt;/EM&gt;, regardless of what the string value 'should be'.&lt;/P&gt;&lt;P&gt;For example, doing this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Load
	Dual(valA,KeyA) as dualX,
	Dual(valA,200) as dualY,
	text(KeyA) as stringA,
	*;

Load * inline [
KeyA, valA
272587940.2021040421074800,	a
272587940.2021040512005900,	b
272587940.2021040516282100,	c
272587940.2021040517541500,	d
272587940.2021040518032700,	e
272587940.2021040523321500,	f
272587940.2021040605040600,	g
]
;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gives you these results, and makes it a little clearer what's happening:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="awwitas_3-1617908989037.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52691i0DE0574A46CE65E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="awwitas_3-1617908989037.png" alt="awwitas_3-1617908989037.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even though we try to explicitly create a &lt;FONT face="courier new,courier"&gt;dual()&lt;/FONT&gt; value with the same number but different text, Qlik doesn't allow that and uses the first loaded string value instead ("a" in this case)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 19:10:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Concatenating-two-fields-separated-by-a-decimal-point-period/m-p/1798113#M8766</guid>
      <dc:creator>awwitas</dc:creator>
      <dc:date>2021-04-08T19:10:11Z</dc:date>
    </item>
  </channel>
</rss>

