Understanding How to Retrieve IDs in SAC: A Step-by-Step Guide for Scripting and Debugging

Estimated read time 4 min read

I’m Filippo Naggi, an Enterprise Architect at Avvale with extensive experience across the entire planning landscape, from BPC to SAC, OneStream, and BigQuery.

 

In SAC, there are times when you need to retrieve an ID to use in filters. In this blog, we’ll explore how to do that. Follow along, as this will also help you understand how to debug effectively.

We’ll set up a filter in a table and learn how to retrieve its technical name by using the debugging functionalities.

Let’t build a table and setup a filter for 2022.

This is the table:

and this is the filter, 2022:

Now we could create a script which is getting executed each time the table will be selected.

 

Using the pop-up menu, let’s ad a onSelect handler for the table:

 

Now we can write the script to get and log the filters.

Console.Log is used to log anything on your browser, for example on Chrome Developer Tool.

getDimensionFilters enable to extract a filter attached to a dimension.

 

This is the code:

Next step is saving our Story and switch to view mode.

Once in view mode, using F12, we can open Chrome Developer Tools.

After selecting the table, the handler will be executed.

Finallly we can look into the log, and extract the payload:

{
“value”: “[Date].[YHQM].[Date.YEAR].[2022]”,
“type”: “Single”
}

Analyzing the payload, we notice the convention used for Date:

[Date].[YHQM].[Date.YEAR].[2022]

 

 

Thank you all for taking the time to read through this guide, I hope it helped clarify how to retrieve IDs and work with filters in SAC.

A special thanks to Boysie for the inspiration and brilliant idea that sparked this blog—your input made this deep dive possible.

 

Stay tuned for more tips and insights, and feel free to reach out if you have any questions or suggestions. Until next time!

 

 

 

​ I’m Filippo Naggi, an Enterprise Architect at Avvale with extensive experience across the entire planning landscape, from BPC to SAC, OneStream, and BigQuery. In SAC, there are times when you need to retrieve an ID to use in filters. In this blog, we’ll explore how to do that. Follow along, as this will also help you understand how to debug effectively.We’ll set up a filter in a table and learn how to retrieve its technical name by using the debugging functionalities.Let’t build a table and setup a filter for 2022.This is the table:and this is the filter, 2022:Now we could create a script which is getting executed each time the table will be selected. Using the pop-up menu, let’s ad a onSelect handler for the table: Now we can write the script to get and log the filters.Console.Log is used to log anything on your browser, for example on Chrome Developer Tool.getDimensionFilters enable to extract a filter attached to a dimension. This is the code:Next step is saving our Story and switch to view mode.Once in view mode, using F12, we can open Chrome Developer Tools.After selecting the table, the handler will be executed.Finallly we can look into the log, and extract the payload:{“value”: “[Date].[YHQM].[Date.YEAR].[2022]”,”type”: “Single”}Analyzing the payload, we notice the convention used for Date:[Date].[YHQM].[Date.YEAR].[2022]  Thank you all for taking the time to read through this guide, I hope it helped clarify how to retrieve IDs and work with filters in SAC.A special thanks to Boysie for the inspiration and brilliant idea that sparked this blog—your input made this deep dive possible. Stay tuned for more tips and insights, and feel free to reach out if you have any questions or suggestions. Until next time!     Read More Technology Blogs by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author