After more detailed investigations together with George Tonkin, below is what we suppose to be the (limited) use case.
First you use the (undocumented) function DimensionEditingAliasSet to pick an existing alias from a dimension.
That alias will receive (meaningful) names of new elements that are added to the dimension, with the function DimensionElementInsertByAlias.
However, you care about the alias values but you do not (necessarily) care at all about the names of the new elements.
They could be dummy element names with an incrementing suffix.
That is what DimensionElementInsertByAlias does
Consider this example. You have a bunch of company names:
- McKenzie, McKenzie and Labadie
- Smitham, Brakus and Flatley
- Smitham, Rau and Greenfelder
But you don't want them to be element principal names because you want to easily change the names.
Still you are confident that no duplicate alias values will exist.
Then this code can be run (or you use a data source rather then all Prolog tab code):
Code: Select all
DimensionEditingAliasSet( 'Company', 'Description' );
DimensionElementInsertByAlias( 'Company', '', 'Thiel-Brekke', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'McKenzie, McKenzie and Labadie', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Smitham, Brakus and Flatley', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Kihn-Huels', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Leffler-Gaylord', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Leffler and Sons', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Hand PLC', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Marvin-Haley', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Smitham, Rau and Greenfelder', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Becker, Bode and Sporer', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Kuhic Inc', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Rempel-Nader', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Quitzon, Moen and Nienow', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Ortiz-Carroll', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Doyle Inc', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Fisher-Kertzmann', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Spencer-Cruickshank', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Ullrich-Nienow', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Larkin-Lueilwitz', 'Comp', 'N' );
DimensionElementInsertByAlias( 'Company', '', 'Jacobi Inc', 'Comp', 'N' );
Result:
- hln.PNG (29.99 KiB) Viewed 7871 times
"Comp" is the common part that is prefixing an underscore character and an incrementing number.
You don't need to store 19 as the last index. Adding a new company name with:
Code: Select all
DimensionEditingAliasSet( 'Company', 'Description' );
DimensionElementInsertByAlias( 'Company', '', 'IBM', 'Comp', 'N' );
gives you:
- hln_2.PNG (6.48 KiB) Viewed 7871 times
Note that:
- You need to provide an existing alias attribute
- Architect / Perspectives allow to save the process, PAW does not and you will be confronted with a sea of red squiggles. It's up to you whether you want that or not, besides the fact that these functions are undocumented but exist for a very long time in TM1.
- hln_3.PNG (32.78 KiB) Viewed 7871 times
It seems that the use case could be: generate dummy/placeholder elements in a dimension to store real element names in a chosen alias.
TM1 will remember the last index used and create the suffix for you, you don't need to maintain what is the last index (which can differ by anything that precedes the suffix). You have the flexibility (and power) of alias values such that users can easily change them. At the same time you don't care about the corresponding element names.
You can insert the same names multiple times. TM1 will not add them multiple times and will also not send minor or major errors. Nothing happens for these elements.
The last but one argument to the function cannot be empty. No error message but nothing happens.
What do you think: useful or not ?