on 2025 Apr 02 4:46 PM
I everyone,
I am new in SAP Analytics Cloud BTW, I am using a story filter (at the left of the story) called HistoryType as you can see from the screenshot:
I also created a listbox and I would like to change the filter as soon as I select something from the list. Is it possible to do that or I should use something else?
Request clarification before answering.
Hi @RoccoCaliandro,
yes that´s quite easily possible. If you just click on the three dots in the top right of your listbox, you´ll get the option "Edit Scripts", which will open the code editor for an "onSelect()" function.
Please enter the following coding:
Application.getFileDataSource("xxx").setDimensionFilterWithHierarchy("yyy", Alias.FlatHierarchy, ["zzz"]);xxx is the ID of your DataSource. DataSource refers to the data model you´re using. Please notice, that you need the ID, not the technical name or description. The easiest way to get the id is just pressing CTRL+Space after entering: "Application.getFileDataSource(". This will open a popup, where you can select of all data models that are currently part of your story.
The same goes for the yyy, your dimension (in your case something like "HistoryType"). Just press CTRL+Space here again.
Last but not least the same CTRL-Space action for the zzz, the values you want to filter "History Type" to.
Best regards,
Denis
PS: If this solution helped you, please mark it as "accepted solution", thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes this is possible. Look at using Application.getFileDataSource().setDimensionFilterWithHierarchy(). Sorry, I don’t have an example handy as I’m away from my laptop. You do need to provide a hierarchy with this method, but you can supply Hierarchy.Flat constant (sorry doing this from memory, so check context help for exact detail).
Cheers, Ivan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.