Keep in mind, mappings done at runtime are just "private mapping" of one user and just valid during one session. (I can think of ways to store and recall this for later sessions, too, but this is not contained in this example)
--> In a standard situation, mappings are done centrally by the developer and exeuted during reload script run. Dimension values are then stored in the data model, valid for all users.
In this app
you can dynamically group customers (technical field name is Kunden.Kundenname) together under a new group name in the frontend (Ajax-Client, Plug-In)
You can select the new group name in a list box which will grow as you keep adding more groups
You can remove single mappings or
clear all mappings and restart
How is this done?
This app stores mappings into two variables, each of which has an equally long list of values: vSearchVal and vReplaceVal. I also introduced a Drill-group, which shows on first level the customer names, if they are not part of a group, or the runtime group name. But when you click on just the group name, the second level will show such customers belonging to the group (standard drill-group behaviour).
I needed to introduce some formulas as calculated dimension to manage this. The functions PICK() and MATCH() achieve the search/replace. Those who can't wait to download the app and look into the Drill-Group definitions, here is the expression for the calculated dimension:
This version stores the dynamic mappings also into bookmarks. On document level, there was a setting per variable to be part of bookmarks or not. The default is, not to store variables in bookmarks. I changed it for vSearchVal and vReplaceVal