Symptom
- A calculated measure is created in the SAC model to display the YTD data. Its formula is similar as ITERATE(IF([d/Date].[p/MONTHDESC]="",0 ,PRIOR() )+[Amount] ,[Amount],[d/Date].[p/CALMONTH] )
- The YTD measure in an SAC Add-in Excel workbook is not displaying the total YTD values but instead shows the monthly amount.
- The YTD value retrieved using the SAP.GETDATA formula does not match the expected total YTD value.
- The issue is inconsistent, with the YTD formula working correctly in some cases but failing in others.
- The issue is observed in both the SAC Add-in workbook and SAC story when the table filter is set to a specific month (e.g., 202502).
- The issue does not happen in the SAC Add-in workbook and SAC story when the table filter is set to the whole year (e.g., 2025).
Environment
SAP Analytics Cloud, add-in for Microsoft Office
Reproducing the Issue
- Open an SAC add-in workbook contains a table whose Date filter is applied to the year level and a SAP.GETDATA formula for a month.
- Observe that the YTD data in the table for the same month differ from the SAP.GETDATA formula. (the YTD data in the table is the expected value)
- Change the Date filter of the table to a single month.
- Observe that the data in the table now becomes the same as the SAP.GETDATA formula. (both the table and the SAP.GETDATA formula show the unexpected value)
Cause
- The YTD formula used in the SAC Add-in workbook references other months for its calculation. When the data for other months is not included in the filter (e.g., when filtering for 202502), the YTD measure only displays a partial value.
- The SAP.GETDATA formula does not retrieve the correct YTD value due to limitations in how the formula interacts with the backend data when filters are applied.
- The issue arises from the design of the YTD formula, which is dependent on the queried set of data and does not account for all required months when specific filters are applied.
Resolution
Option 1 (Workaround):
- If you want to get the SAP.GETDATA() functions to work with the same formula ITERATE(...), you must query on the year (e.g. 2025) and month (e.g. 202502) in the SAP.GETDATA formulas by forcing a drill level of -1 for the Date dimension.
- Refer to KBA 3323835 for details on customizing drill levels.
- But it is not a good approach because (1) it may negatively impact the performance (2) the YTD measure is still wrong if you display it in the table or chart and set filter to a specific month.
Option 2 (Recommended Solution):
- Redesign the YTD formula to ensure it retrieves the correct value regardless of the table filter settings.
- Refer to the example formula: LOOKUP([AMOUNT],[d/Date]=ToPeriod("Year")).
- Collaborate with SAC consultants or post a question in the SAP Community for assistance in creating a suitable YTD formula for your company.
Keywords
ytd calculation, sac add-in, sap.getdata formula, SAP.GETDATA() formula, GETDATA, sac excel workbook, sac integration, dynamic time calculation, sac ytd issue, sac table filter, sac calculated measures, ytd formula redesign, sac performance optimization, year to date, year-to-date, time dimension, sac excel addin , KBA , LOD-ANA-OF-XLA , SAP Analytics Cloud, add-in for Microsoft Office , LOD-ANA-TAB , Table , LOD-ANA-DES-CAL , SAC Story Calculations , Problem
Product
SAP Analytics Cloud, add-in for Microsoft Office 1.0
SAP Knowledge Base Article - Public