Another common request I get from clients is how to rename the row and column groups within an OLAP data map. To clarify what I’m referring to, it is the data retrieval specification groups that fall under Column and Row Members in an OLAP Data Map.
By default Studio calls these Group1, Group2, … with unique names within each section and data map. This makes it very difficult when reviewing a document to determine what each group is doing. I often find myself clicking through a bunch of them to find the specification I’m looking for since I’ll never remember that Group5 is the specification for Salary. It unfortunately that Clarity did not give these unique names across the entire document, otherwise we would have been able to simply search & replace through the template code. I’ve heard that a future release of Studio may allow for these to easily be renamed, however in the meantime the following steps will allow you to rename them. [Update Nov 2012 – the ability to easily rename groups in OLAP data maps has been added as of the 7.2.1 FP1 release of Studio. This post however is still relevant for those users still running an older version of Studio]
There are 3 places each group needs to be renamed:
- 1. <OlapDataQuery> – Row and Column Group section
- 2. <Views> – Row and Column Group section
- 3. <Grid> – Row and Column Members within the <Mappings> section
- Step 1. Take a backup of the .template file
As we will be manually updating the document definition it’s very easily to accidentally change the wrong value or make a typo. A backup is good way to revert back to a working copy or just to compare what the code looked like before your changes.
- Step 2. Manually Find and Replace the Column Groups in the OlapDataQuery section
As the Columns are added first within the document code, they are a good place to begin. Starting with Group1, search through the code for ‘Group1’ within the Column <Groups> section the <OlapDataQuery>. This should be the first Group1 you come across if you use the Find <Ctrl-F> functionality within the Clarity code.
Change this entry to your desired name. For this example I will call this column group ‘Months’. As soon as you rename it you will see the change reflected in the data map – but in order for the report to work, we have a few other steps to complete.
- Step 3 – Manually Find and Replace the Column Groups in the Views section
Replace the Group1 name in the <ColumnGroups> area of the <Views> section with the same name used in Step 2 above.
- Step 4 – Manually Find and Replace the Column Groups in the Grid section
Replace the Group1 name in the <Mappings><ColumnGroups> area of the <Grid> section with the same name used in Step 2 above.
- Step 5 – Repeat Steps 2 to 4 for the Row Groups.
If you only have 1 OLAP Data Map you most likely can now do a search and replace on Group1 for the Rows, as they should be the only instances of that text in the code. If you have multiple OLAP data maps however then you will need to do it manually.
In my example I’m replacing the Group1 Row name with ‘Salary’.
With the completion of this final step you will have successfully renamed your OLAP Data Groups, making your templates and reports much easier to maintain.
My final version now have useful names for the Column and Row Groups!
As always I invite any comments or feedback on my posts, including ideas for new ones!