Filter BW Query Key Figure Structure or apply BW Query Condition is a common requirement for BIAL Script. What developers tend to do is to quickly hardcode technical names, but on the long it will make support and maintenance an issue. Here are disadvantages of hardcoding technical names:
- Technical name are cryptic and make your code not readable;
- Technical name changes require BIAL script update;
- Condition technical name is not available in BW Query designer.
In my blog I will explain how to use simple BIAL Script functions to get technical names for BW Query Key Figure and BW Query Condition.
Get_Measure_Member_Id script function gets DataSource and Key Figure name as an input and returns Key Figure technical name
Note: make sure that Key Figure names are unique in your BW Query
Below is an example how to use above function to get BW Key Figure technical names:
Note: if BW Query Key Figure name is spread between multiple lines, then in BIAL script CR LF should be coded as
Get_Measure_Filter_Id script function gets DataSource and Condition name as an input and returns Condition technical name.
Note: make sure that Condition names are unique in your BW Query
Below is an example how to use above function to get BW Condition Technical Name: