I am trying to use a time slot filter for a chart in SAC. The filter should include all months from january till the current month. This is the code i am using, but unfortunalty it only shows the last month. The filter should be set when the page opens.
function onInitialization() : void
var currentDate = new Date(Date.now());
var currentMonth = currentDate.getMonth();
var timeSlot = ArrayUtils.create(Type.string);
chartCompare.getDataSource().removeDimensionFilter("0CALCMONTH2";
for (var i = 1; i<=currentMonth; i++)
{
timeSlot[i]="0"+i.toString();
chartCompare.getDataSource().setDimensionFilter("0CALMONTH2", timeSlot[i]);
}
The chart is filtered by month but the previous months are removed.
Hope someone can help.
Many thanks in advance.