cancel
Showing results for 
Search instead for 
Did you mean: 

SAC - How to use getResultSet in an array for selection

rahulkavuri
Active Contributor
0 Kudos

I am new to SAC Application Designer. I want to use calendar month results from one table as a source for selection in other charts. Struggling with the array syntax I should using for Cal_Months variable setDimensionFilter

var resultSet = CalMonth_Source.getDataSource().getResultSet();

//Reverse the order
resultSet.reverse();

var firstcall = 'X';

var Cal_Months=ArrayUtils.create(Type.string);

for (var i=0;i< resultSet.length; i++)
	{	
		if(resultSet[i]["0CALMONTH"].description!=='Totals'){			

//No syntax error when I use ID but my results 
		Cal_Months.push(resultSet[i]["0CALMONTH".id]);


//Based on other blogs I have read I am supposed to use the below syntax but I get errors that
//data context cannot be converted to string
//		Cal_Months.push(resultSet[i]["0CALMONTH"]);
			
	}}


console.log(Cal_Months);

ConsVendor.getDataSource().setDimensionFilter("0CALMONTH",Cal_Months);<br>

YanGerzon
Participant
0 Kudos

Hi,

I am facing a similar problem.
"The chart had a dynamic calendar month filter in the default variant, I set the variable to blank and enabled 'Keep last saved values for dynamic variables' to resolve the issue"

How/Where is this done?

View Entire Topic
chia-yu_wu
Active Participant
0 Kudos

Try to console.log() the resultSet from the chart you need.

My suspicion is that the Chart you want to filter has a different Date hierarchy.

rahulkavuri
Active Contributor
0 Kudos

Thank you Chia.

The chart had a dynamic calendar month filter in the default variant, I set the variable to blank and enabled 'Keep last saved values for dynamic variables' to resolve the issue