PickList to show Alias but store Element Name: Websheet approach
Posted: Mon Feb 08, 2021 4:10 pm
There is a great but undocumented solution In this topic, which did not suit one of my customers: they do not want to see huge GUID-like codes in their interface, even with the rule-based "name" measure near them. So I found another way to do this:
Assume we have:
The websheet will look like this:
Assume we have:
- Cube "test picklist" with 2 dimensions: list and measures.
- Measures dimension with 2 elements: "Input measure" with "subset:dim:sub" picklist in it; and "Code from picklist", where we will put the element name and which we will use in rules/processes/etc
- Dimension "Test dim", used for the picklist. Has "Name" alias used in subset, and "Code" attribute = element name.
The websheet will look like this:
- Input measure - the only visible to user. Users select values using picklist here. =DBRW($B$12;$B17;C$16)
- Code calc - used to calculate the code of value, selected in "Input measure". Blank is nothing is selected. =IFERROR(DBRA("Demo:Test dim"; C17; "Code"); "")
- Code from picklist - used to send code to TM1. =IF(OR(E17 <> ""; C17 = ""); DBSS(E17; $B$12;$B17;D$16); "")
E17 <> "" is used to prevent sending a blank code when the alias changes.
C17 = "" is used to send a blank code when the "Input measure" value is deleted