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

Way to automate editing multiple query items?

Started by LostInTime, 19 Jul 2018 11:51:41 AM

Previous topic - Next topic

LostInTime

Hey all,

Just had a quick question. I need to edit multiple query items and change their description. I am a bit of newbie to using this software, but google hasn't been helping too much. Is there a way to easily find query items, or perhaps edit them with a script? E.g. create a script to read a csv file, find the query item and auto write the description using the info provided in the CSV?  or perhaps an internal tool I should familiarize myself with?

Thank you for reading!

EDIT: When locating the query items, there is a proprieties file "attached" to the query item. Is there anyway even to export that to something like excel or a csv sheet where I could easily edit it with a programming language like python?

Lynn

Quote from: LostInTime on 19 Jul 2018 11:51:41 AM
Hey all,

Just had a quick question. I need to edit multiple query items and change their description. I am a bit of newbie to using this software, but google hasn't been helping too much. Is there a way to easily find query items, or perhaps edit them with a script? E.g. create a script to read a csv file, find the query item and auto write the description using the info provided in the CSV?  or perhaps an internal tool I should familiarize myself with?

Thank you for reading!

EDIT: When locating the query items, there is a proprieties file "attached" to the query item. Is there anyway even to export that to something like excel or a csv sheet where I could easily edit it with a programming language like python?

Here are a couple links that might give you ideas:

https://www.ibm.com/developerworks/community/forums/atom/download/attachment_14197152_Bulk_Loading_Screen_Tips_into_Framework_.doc?nodeId=b8ca17f1-1b23-46cf-8ab9-2a2ed873393f

https://www.ibm.com/support/knowledgecenter/SSEP7J_10.2.1/com.ibm.swg.ba.cognos.ug_fm.10.2.1.doc/t_replaceobjectsinthemodel.html

CognosPaul

At the end of the day the model is just an XML file. If you're any good with xpath it should be possible to write a quick script with whatever language you want.

LostInTime

Quote from: Lynn on 19 Jul 2018 12:09:46 PM
Here are a couple links that might give you ideas:

https://www.ibm.com/developerworks/community/forums/atom/download/attachment_14197152_Bulk_Loading_Screen_Tips_into_Framework_.doc?nodeId=b8ca17f1-1b23-46cf-8ab9-2a2ed873393f

https://www.ibm.com/support/knowledgecenter/SSEP7J_10.2.1/com.ibm.swg.ba.cognos.ug_fm.10.2.1.doc/t_replaceobjectsinthemodel.html

Thank you, I had reviewed the links and the issues I came up with are:

Link 1: Editing a bunch of query items, say like 25, is difficult in one excel sheet since everything is "disorganized" and not all relevant data is in one column, it is all over the place. Guide said I should do one by one, but that seems counterproductive and resorts back to "manual labor"

Link: Would still have to edit the files individually, and it seems I can only add a description en masse e.g. the same string for them all. Each string is unique to each value. I'd have to manually re-enter a new one.

With that being said, maybe I am missing something/doing something wrong or perhaps there are other options I could try doing?

LostInTime

#4
Quote from: CognosPaul on 19 Jul 2018 12:14:26 PM
At the end of the day the model is just an XML file. If you're any good with xpath it should be possible to write a quick script with whatever language you want.

I would interested in accessing my model as an xml file, how would I be able to achieve this? I'm somewhat familiar with xpath and I'm sure I could figure any issues with it if they arose.

I know the model saves as a cpf file, and theres multiple xml files next to it. Do these files contain all the query items and query subjects? I have skimmed but was unable to find everything, I opened them in a text editor. Should I be using a different program?

EDIT: So wow I was able to change the description, I guess everything is there in model.xml. Had to use notepad++ instead of visual studio. Yeah going to have to play with this and learn some xpath which will be helpful. Its very disorganized but, this is a good starting point. Thanks for the suggestion

CognosPaul

On notepad++ you can use XML Tools to tidy the model up a bit. Once you get the basic structure down, you can write a script to do it. I don't know Python, but I understand it does support xpath, so you should be able to get it to do what you need.

LostInTime

Wow I am dumb.

I thought you couldn't edit the model via text editor because I tried visual studio code and it wouldn't load the entire document, only to like line 135...

Tried notepad++ and it works wonder, and just figured it out and wrote a small script. Going to test it out now and see if it works, thanks for the heads up guys :)