<?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: Wrong data type identified in calculations in Data and Analytics Forum</title>
    <link>https://community.sap.com/t5/data-and-analytics-forum/wrong-data-type-identified-in-calculations/m-p/13951281#M91</link>
    <description>&lt;P&gt;DSP messes up the datatypes.&amp;nbsp;I always use CAST("FIELD" AS [datatype]) AS "FIELD", unless you&amp;nbsp;can correct the datatype in the Attributes property - that is easier of course then to CAST&lt;/P&gt;</description>
    <pubDate>Thu, 28 Nov 2024 19:14:41 GMT</pubDate>
    <dc:creator>Martin_Kuma</dc:creator>
    <dc:date>2024-11-28T19:14:41Z</dc:date>
    <item>
      <title>Wrong data type identified in calculations</title>
      <link>https://community.sap.com/t5/data-and-analytics-forum/wrong-data-type-identified-in-calculations/m-p/13948536#M89</link>
      <description>&lt;P&gt;When creating new calculations with the FX transformation, in many cases DSP seems to get ‘lost’ in identifying the data type derived from the calculation.&lt;BR /&gt;For example the expression&lt;/P&gt;&lt;PRE&gt;CASE WHEN EMAIL IS NULL THEN true ELSE false END&lt;/PRE&gt;&lt;P&gt;is correctly identified as a BOOLEAN type.&lt;/P&gt;&lt;P&gt;But with a small modification&lt;/P&gt;&lt;PRE&gt;CASE WHEN IFNULL(EMAIL, '') = '' THEN true ELSE false END&lt;/PRE&gt;&lt;P&gt;It gets messed up and says it returns a STRING, which is incorrect.&lt;/P&gt;&lt;P&gt;What do you do in these cases?&lt;BR /&gt;Do you force the conversion with something like&lt;/P&gt;&lt;PRE&gt;TO_BOOLEAN(CASE WHEN IFNULL(EMAIL, '') = '' THEN true ELSE false END) &lt;/PRE&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;I'm not sure about the processing impact of having lots of conversion functions (or LEFTs, etc) that are not necessary, but if we don't put them when validating DSP returns the wrong type of data, maybe the HANA optimizer discards them?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 08:58:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/data-and-analytics-forum/wrong-data-type-identified-in-calculations/m-p/13948536#M89</guid>
      <dc:creator>XaviPolo</dc:creator>
      <dc:date>2024-11-26T08:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong data type identified in calculations</title>
      <link>https://community.sap.com/t5/data-and-analytics-forum/wrong-data-type-identified-in-calculations/m-p/13951281#M91</link>
      <description>&lt;P&gt;DSP messes up the datatypes.&amp;nbsp;I always use CAST("FIELD" AS [datatype]) AS "FIELD", unless you&amp;nbsp;can correct the datatype in the Attributes property - that is easier of course then to CAST&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 19:14:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/data-and-analytics-forum/wrong-data-type-identified-in-calculations/m-p/13951281#M91</guid>
      <dc:creator>Martin_Kuma</dc:creator>
      <dc:date>2024-11-28T19:14:41Z</dc:date>
    </item>
  </channel>
</rss>

