Symptom
You use the TimeRange as below but it doesn't work.
TimeRange.create(
TimeRangeGranularity.Day,
start_date,
end_date )
Environment
SAP ANALYTICS CLOUD,1.0.
Reproducing the Issue
You have a "user-managed" date dimensions and the TimeRange API is used for it.
Cause
Currently, using TimeRange-related APIs in "User-managed" date dimensions is not supported.
"User-managed" date dimensions could be some customized date ranges, so if we allow real date ranges for "User-managed" date dimensions, these two kinds of date contexts may not match.
Resolution
You cam use a single value in "User-managed" date dimensions, for example,
Chart_1.getDataSource().setDimensionFilter("user_managed_date","[user_managed_date].[YQM].[(all)].[2021].[Spring]");
or use TimeRange-related APIs in "System-managed" date dimensions.
If you do want us to implement this, you may submit and/or vote on your idea at
Keywords
KBA , LOD-ANA-UNS-SCR , Unified Story Scripting related Issues , Problem