Symptom
Weight field (type 'number') of 'Goal Management Domain' is displayed under 'Text' type when creating a Calculated column in Live Data reporting.
Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental
Environment
- SAP SuccessFactors HCM Suite
- Canvas - Detailed Reporting
Reproducing the Issue
- Create a new Report-Canvas
- Add List Report Component > Edit Query > Detailed Reporting > New
- Under Live Data > Fetch the Weight Field
- Try creating a Calculated Column by clicking Edit > Calculated Columns
- You will find 'Weight' under Text type but NOT Number type
Cause
Weight Field is a Custom field defined in the Goal Template. The fields with reportable attribute defined in template are all custom fields.
Custom fields can be of type text, number and so on. So the DB columns for these custom fields are pre-defined as "string" type. This is because we cannot predict the data type of custom fields.
Hence custom fields will be visible under Text type irrespective of their data type in the template.
Resolution
Only Standard Fields will be displayed under their respective data type.
As you see this is a custom field:
AdHoc report displays the right data type:
However, in Detailed Reporting Calculated Column, the field is displayed under Text type:
Workaround: Design an If-else loop to convert String to number. You may even build a nested-if-loop to convert multiple values.
Logic:
If (String (Weight) == Text(10) ){
Then{
StrToNum = Number(10)
}
}else {
StrToNum = Number(0)
}
Design:
Note that the data type for (10) and (0) in the "if statement" are text or number, please ensure the value is correctly selected as "text" or "number" to avoid error. as below.
- If (Weight == 10 ( 10 is selected as text ),
- Then Value = 10 (10 is selected as Number )
- Else Value = 0 (0 is selected as Number )
Keywords
weight, goal, management, report, text, number, conversion, string, field, showing, wrong, data, type, ORD, format, canvas , KBA , LOD-SF-ANA-ORD , Online Report Designer , LOD-SF-ANA , Analytics & Reporting (Ad Hoc, YouCalc, ORD) , Problem