SAP Knowledge Base Article - Public

3669859 - Calculated column shows different results in the Query Preview than in the Table

Symptom

The calculated column created in the data source is showing a different data than the one created in the table, although they have the same formula.

Environment

  • SAP SuccessFactors HCM Suite
    • Story Report

Reproducing the Issue

  1. Create a calculated column in the data source, for example "IF (A > B, X, Y)" where A and B have more than 1 row of data. Preview the query and see that in some rows, A > B is true, but in some rows A > B is false.
  2. Create the same calculated column in a Cross-Tab/Aggregated Table, add the calculated column too that was created in the data source.
  3. See that the 2 calculated column shows 2 different results, although they have the exact same formula

Cause

The formula created in the data source is applied to each row individually, meanwhile the one in the Cross-Tab/Aggregated Table is applied to the SUM of the rows.
Because of that, the formula on the Cross-Tab/Aggregated Table will always have one result, meanwhile the one in the data source could have different results.

Resolution

In order to have the expected result, the formula has to be applied to the SUM of the data:

Use the calculated column in the Cross-Tab/Aggregated Table as it automatically SUM the data of the columns.

Keywords

Calculated Column, Cross-Tab, Aggregated Table, Non-Aggregated Table, Different result, , KBA , LOD-SF-ANA-SAC-QDS , Query Designer - Filter, Calculated Column, Params , Problem

Product

SAP SuccessFactors HCM Suite all versions