on ‎2023 Jun 15 4:47 PM
Hi SAC experts,
I would like to know if it's possible to pass filters to Data Analyzer from an Analytical Application. I'm using the NavigationUtils.openDataAnalyzer API but without success.The model is the same in AA and DA but believe doesn't matter.
I know how to pass filter values from AA to a Story and AA to AA but even simple parameter such as embed mode as been difficult.
Below one example of my code, I have tried only 1st parameter, only 2nd parameter and both parameters.
NavigationUtils.openDataAnalyzer('&/dz/9102B879DBA6EE5C878C23D8A9E21EF',undefined,[UrlParameter.create("Country/Region","Germany"),UrlParameter.create("mode","embed")]);
Also, is there any documentation of URL API for Data Analyzer? like this one for Story SAP Analytics Cloud URL API
The behavior I want to replicate is the one we get when we open a Data Analyzer from a table in the new Optimized Design Experience Story, where the filter values are passed to the Data Analyzer (Image attached).
Thank you for your time.
Request clarification before answering.
There are two approaches that can get this done:
1.- Opening the Data Analyzer without creating a Data Analyzer story ( the best way 😞
NavigationUtils.openDataAnalyzer("&/dz/?dataSourceName=".concat(Table_1.getDataSource().getInfo().modelId).concat("&systemType=MODEL&f01Dim=P_ACCT&f01Val=CS_CONTROLLING_STRUCTURE"));
Above line makes it dynamic no matter which source you are using, only replace Table_1 for your table on the story to pass the datasource. The first part of the parameter string I got it from another contributor :
"&/dz/?dataSourceName=".concat(Table_1.getDataSource().getInfo().modelId).concat("&systemType=MODEL"
then you can see you can concat the parameters passing same way as you do for stories:
&f01Dim=P_ACCT&f01Val=CS_CONTROLLING_STRUCTURE"
2.- Opening a Data Analyzer already created story passing parameters to it :
var urlParameters = ArrayUtils.create(Type.UrlParameter);
urlParameters.push( UrlParameter.create("f01Dim", "VERSION"));
urlParameters.push( UrlParameter.create("f01Val", "public.2024_PLAN_ISR_1"));
NavigationUtils.openStory( "CB3A9F013593C6D688AC99F1A244ECA5", "a31b3cd2-f023-4b22-ac46-3e90b81c8e7a", urlParameters, true);
where
CB3A9F013593C6D688AC99F1A244ECA5 = story ID
a31b3cd2-f023-4b22-ac46-3e90b81c8e7a = page ID
you can get both above by hitting Ctrl+Space when writing the sintax line and the system will help you select the Data Analyzer story and get both Ids automatically.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For anyone that need to pass a parameter into data analyzer for a dimension that has a hierarchy, here is an example of the encoding that need to be passed as f0xVal (2 values at different levels of a hierarchy:
%5B%22[dimension].[H1].%2526[value1]%22,%22[dimension].[H1].%2526[value2]%22,%5D
H1: this is the ID of your hierarchy
%5B = [
%5D = ]
%22 = "
%2526 = & (has to be encoded twice)
To implement this, what I did was to extract values from a story filter or an input control into an array and replaced the ampersand by %2526 and then concatenated into a single string to be passed into f0xVal.
ruivarela
I haven't tested the url parameters ( for filtering ) but to just open the data analyzer from analytic application/stories 2.0 on button click, you can use the below . This is based on the same model my story was.NavigationUtils.openDataAnalyzer("&/dz/?dataSourceName=t.2Q.Ct504e17qcsmrfon929702t8a4o:Ct504e17qcsmrfon929702t8a4o&systemType=MODEL");


On Button click

Hope this helps !!
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ruivarela
I have been trying to pass url parameters but without success to Data Analyzer. I have tried the below but it does not work.
NavigationUtils.openDataAnalyzer(undefined,"&/dz/?dataSourceName=t.2Q.Ct504e17qcsmrfon929702t8a4o:Ct504e17qcsmrfon929702t8a4o&systemType=MODEL",[UrlParameter.create("f01Dim","Date"),UrlParameter.create("f01Val","20231")]);
Please revert if you manage to pass the parameters successfully.Nikhil
Have you tried adding the Op parameter?
Also, i'm not sure your connection and data source parameters are correct. Try updating your call with this but ensure that the first parameter is the name of your connection and the second parameter is the name of your model:
NavigationUtils.openDataAnalyzer("ConnName","ModelName",[UrlParameter.create("f01Dim","Date"),UrlParameter.create("f01Val","20231"),UrlParameter.create("f01Op","in")],true);
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.