If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Easy way to update a lot of query item names?

Started by shawnzhao123, 13 Jan 2011 05:46:03 PM

Previous topic - Next topic

shawnzhao123


Is there a way to update a lot of query item names without manually change them one by one?
My table column names are following name standard like: name_1 ..... name_500
I want to update these columns to meaningful names that user can understand, which I already had them in an excel file like this:
name_1      name string 1
name_2     name string 2
.
.
.
name_500    name string 500

Any helps will be appreciated? thanks

Shawn

cognostechie

Do it at your own risk !

Open model.xml file in Notepad and do a search and replace.

blom0344

This is really quite a bit more tricky than doing a simple search and replace. You actually need to know which part of the xml needs updating. For instance if you have a model query subject that references a sql query subject, you may need/want to update only the former. So the best approach is to :

1. copy the model.xml as  model_old.xml
2. Change one data item through FM manager
3. Compare both  .xml files to check WHERE changes are applied

Everything - as mentioned - at your own risk!!

MFGF

One other solution is to use the multilingual support features to do this.  If your model currently uses a single language (eg en), add a second language to the model (such as en-nz), then use the 'export language file' option.  This will create a text file with two columns of data - one for en and one for en-nz.

Edit the text file and replace all the names in the 'en' column with your meaningful names (or cut and paste the data from your existing excel file, making sure that the original names are in the en-nz column and the meaningful names are in the 'en' column.

Finally, import the language file, converting from en-nz to en, and all the item names should get updated in one hit.

Regards,

MF.
Meep!

shawnzhao123

Thank you all. It works for exporting and importing the languages.

RobsWalker68

Nice solution MF.

I really like that and one I am going to add to my bag of tricks.  It's the kind of solution I could role out in front of a client and make myself look more intelligent than i actually am!

Cheers

Rob

eliza_jane

Hey MF, that was a cool out-of-the-box solution. Great work.

MFGF

Thanks to both of you for the kind words! :)
Meep!

FM

Ok, why do this? AS MFGF notes, it is dangerous. You could end up changing something you shouldn't have. Plus, Framework Manager has this capability built in!

Open you model, and on the right you have the Summary/Search/Dependencies Tab.
Choose search, and you find an advanced search capability that lets you pick in what part of the model you want to limit your search (for example, only the Transformation Layer...), you can search by class (object name, table name, namespace and so on), you can search with capabilities such as:

  • begins with
  • end with
  • contains
  • regex
and of course, it contains a bulk replace. I also use it sometimes to select many object at once if need be. Very useful capability which saves loads of time in modeling.

Yunus

For adding hundreds of security groups to a model I used a program called Advanced Find and Replace 5.  It has "cyclic" find and replace.  Using your excel spreadsheet it could automatically go in and change A to B and then on the next one change A to C or whatever you want based on your spreadsheet.