<?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>Question Re: SAPUI5: Wrong Deviation Calculation for KPI/DataPoint in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sapui5-wrong-deviation-calculation-for-kpi-datapoint/qaa-p/14062029#M4908818</link>
    <description>&lt;P&gt;After discussing the issue with one of the developers of the framework, a fix was released in the latest patch level 28 (SAPUI5 version 1.120.28). The deviation calculation now behaves as expected again.&lt;/P&gt;&lt;P&gt;See this note to update to a newer patch level:&amp;nbsp;&lt;A href="https://me.sap.com/notes/3155948" target="_blank"&gt;https://me.sap.com/notes/3155948&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Mar 2025 13:42:09 GMT</pubDate>
    <dc:creator>tobias_grimm_ksg</dc:creator>
    <dc:date>2025-03-31T13:42:09Z</dc:date>
    <item>
      <title>SAPUI5: Wrong Deviation Calculation for KPI/DataPoint</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-wrong-deviation-calculation-for-kpi-datapoint/qaq-p/13962875</link>
      <description>&lt;P&gt;I have an SAPUI5 application that is based on an FIORI Elements Overview Page template.&lt;BR /&gt;One of my cards on the OVP shows an KPI header with the following values:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;KPI Value: Average Delivery Delay (in days) for the past 90 days&lt;/LI&gt;&lt;LI&gt;Target Value: Average Delivery Delay (in days) for the past 365 days&lt;/LI&gt;&lt;LI&gt;Automatically calculated deviation of the values&amp;nbsp; in %&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;We recently upgraded our system from S/4 2020 SP3 to S/4 2023 SP1. This included updating SAPUI5 libraries from 1.84.6 to 1.120.0. After the upgrade, the deviation calculation shows a wrong value. Before it worked as expected.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tobias_grimm_ksg_0-1734095637564.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/201246i9FFDBAE26F96476C/image-size/large?v=v2&amp;amp;px=999" alt="tobias_grimm_ksg_0-1734095637564.png" title="tobias_grimm_ksg_0-1734095637564.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;                
&amp;lt;Annotation Term="UI.DataPoint" Qualifier="DataPointDurchschnittLieferverzug"&amp;gt;
	&amp;lt;Record Type="UI.DataPointType"&amp;gt;
		&amp;lt;PropertyValue Property="Title" String="{@i18n&amp;gt;datapoint_title_durchschnitt_lieferverzug}" /&amp;gt;
		&amp;lt;PropertyValue Property="Description" String="{@i18n&amp;gt;datapoint_title_durchschnitt_lieferverzug}" /&amp;gt;
		&amp;lt;PropertyValue Property="Value" Path="AvgDelivToCmtdDelivDelayInDays" /&amp;gt;
		&amp;lt;PropertyValue Property="CriticalityCalculation"&amp;gt;
			&amp;lt;Record Type="UI.CriticalityCalculationType"&amp;gt;
				&amp;lt;PropertyValue Property="ImprovementDirection" EnumMember="UI.ImprovementDirectionType/Minimize" /&amp;gt;
				&amp;lt;PropertyValue Property="ToleranceRangeHighValue" Decimal="3" /&amp;gt;
				&amp;lt;PropertyValue Property="DeviationRangeHighValue" Decimal="5" /&amp;gt;
			&amp;lt;/Record&amp;gt;
		&amp;lt;/PropertyValue&amp;gt;
		&amp;lt;PropertyValue Property="TrendCalculation"&amp;gt;
			&amp;lt;Record Type="UI.TrendCalculationType"&amp;gt;
				&amp;lt;PropertyValue Property="ReferenceValue" Path="AvgDlvToCmtdDlvDelayPast365Day" /&amp;gt;
				&amp;lt;PropertyValue Property="UpDifference" Decimal="1" /&amp;gt;
				&amp;lt;PropertyValue Property="StrongUpDifference" Decimal="2" /&amp;gt;
				&amp;lt;PropertyValue Property="DownDifference" Decimal="-1" /&amp;gt;
				&amp;lt;PropertyValue Property="StrongDownDifference" Decimal="-2" /&amp;gt;
			&amp;lt;/Record&amp;gt;
		&amp;lt;/PropertyValue&amp;gt;
		&amp;lt;PropertyValue Property="ValueFormat"&amp;gt;
			&amp;lt;Record Type="UI.NumberFormat"&amp;gt;
				&amp;lt;PropertyValue Property="NumberOfFractionalDigits" Int="1" /&amp;gt;
			&amp;lt;/Record&amp;gt;
		&amp;lt;/PropertyValue&amp;gt;
	&amp;lt;/Record&amp;gt;
&amp;lt;/Annotation&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 13:17:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-wrong-deviation-calculation-for-kpi-datapoint/qaq-p/13962875</guid>
      <dc:creator>tobias_grimm_ksg</dc:creator>
      <dc:date>2024-12-13T13:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5: Wrong Deviation Calculation for KPI/DataPoint</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-wrong-deviation-calculation-for-kpi-datapoint/qaa-p/13988779#M4899538</link>
      <description>&lt;P&gt;I guess I found the problem. The calculation of the deviation happens in the Frontend in &lt;STRONG&gt;sap.ovp.cards.Annotation-Helper.js&lt;/STRONG&gt;. The following line was added in this function:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function returnPercentageChange(iKpiValue, iTargetValue) {
   //...
   if (typeof iKpiValue == "string") {
      iKpiValue = NumberFormat.getIntegerInstance().parse(iKpiValue);
   }
   //...
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Since the KPI and Target values are retreived from the backend, they are read from the JSON response and will always be of type "string". Regardless of the actual type of the KPI, this code will always convert it to an integer. This causes two problems:&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Fractional digits will be lost&lt;/LI&gt;&lt;LI&gt;With german language settings, values like "65.123" will be converted to 65123 instead of 65.123&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The combination of these two problems will cause the weird deviation values.&amp;nbsp;&lt;BR /&gt;I do not know why this line was added by SAP and why an Integer Conversion is used. Unlike the KPI value, the Target value is just converted to decimal using an implicit conversion...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 08:39:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-wrong-deviation-calculation-for-kpi-datapoint/qaa-p/13988779#M4899538</guid>
      <dc:creator>tobias_grimm_ksg</dc:creator>
      <dc:date>2025-01-17T08:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5: Wrong Deviation Calculation for KPI/DataPoint</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-wrong-deviation-calculation-for-kpi-datapoint/qaa-p/14062029#M4908818</link>
      <description>&lt;P&gt;After discussing the issue with one of the developers of the framework, a fix was released in the latest patch level 28 (SAPUI5 version 1.120.28). The deviation calculation now behaves as expected again.&lt;/P&gt;&lt;P&gt;See this note to update to a newer patch level:&amp;nbsp;&lt;A href="https://me.sap.com/notes/3155948" target="_blank"&gt;https://me.sap.com/notes/3155948&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 13:42:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-wrong-deviation-calculation-for-kpi-datapoint/qaa-p/14062029#M4908818</guid>
      <dc:creator>tobias_grimm_ksg</dc:creator>
      <dc:date>2025-03-31T13:42:09Z</dc:date>
    </item>
  </channel>
</rss>

