cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Analytics Cloud - URL parameter for hierachy (open a new story)

pathenrich
Discoverer
0 Kudos

Hello,

we need to take the selected filter value(s) of the used hierachy into another story per url parameter. We offer a multiple selction for that hierarchy. The opening of the story is started by the clock on a button. 

 pathenrich_0-1707844202637.png

The problem is, that a variable as an array is not allowed to use as a parameter.

pathenrich_1-1707844684247.png

We use the following coding on click on the button:

 
var aCluster = Application.getFileDataSource("C7n06cr8mgd1v5b538230531mo").getDimensionFilters("_TB_QMC_SB∞3");
 
 
for (var i=0; i<aCluster.length; i++) {
 
switch (aCluster[i].type) {
 
case FilterValueType.Single:
var singleValue = cast(Type.SingleFilterValue, aCluster[i]);
 
console.log(singleValue.value);
 
break;
 
 
case FilterValueType.Multiple:
var multipleValue = cast (Type.MultipleFilterValue, aCluster[i]);
 
 
console.log(multipleValue.values[i]);
 
var aString =  ArrayUtils.create(Type.string);
aString[i] = multipleValue.values[i];
 
console.log(aString[i]);
}};
 

I only get the first node back into my var aString. But I need a string of all selected filters, separated with " , "  to put it into the url parameter. 

Can anybody help me with that coding? Or have another solution. We need to write this filter values in the filter dimension of the new story. It have to change there. 

Patrizia

Accepted Solutions (0)

Answers (1)

Answers (1)

JefB
Active Contributor
0 Kudos

Hi,

1) You could try passing it as one string. By using Array.join() you can merge all elements into one string. Then use String.split() in receiving story to split the elements again if needed.

2) Passing multiple elements is also supported by the standard URL API. So you don't really need to define any URL script variables, but can simply pass the right elements as URL parameters.

3) There's also an interesting improvement coming in QRC1 2024 (go-live next week) for Story hyperlinks that can be configured better to pass dimension filters:
https://community.sap.com/t5/technology-blogs-by-sap/what-s-new-in-sap-analytics-cloud-release-2024-... 

pathenrich
Discoverer
0 Kudos

Thanks very much, I will check option 1.

Option 2 didn't work in our case (maybe I have to test again) and option 3 is a great new feature, but a not changeable filter in the new story and only a static hyperlink filter. 

Have a great day.