Search code examples
cognos-10

COGNOS SCRIPT to update mdl file PowerCube Description Tab


I am currently using Cognos 10.2.1. I have multiple model files (.mdl or .pyj it doesn't matter). On these model files there are PowerCubes and in these PowerCubes there is a Description Tab that ultimately equals the "explain" button on the published Cognos Cube. My question is, is there a way to update said "Description" or "explain" button in the model file with a script.

Here is an example of a script I use to update the PowerCube Output file path/name in the PowerCube properties (on the Output tab):

OpenPy "\\path_to_my_file\filename.pyj"
CubeUpdate "PowerCubeName"
MDCFile "\\path to my output folder\filename.mdc"
SavePy "\\path_to_my_file\filename.pyj"

So ultimately if I could figure out what I need to change MDCFile to, to force this script to update the Description tab, I think I am golden. I just have not found any answers on IBM's site or any other google searches.


Solution

  • Guess I'm going to answer my own question. I decided to open the .mdl file itself and look for a current description in the model file.

    Found out that it is labeled: Information

    So my code to get this to work is:

    OpenMdl "\\path_to_my_file\filename.mdl"
    CubeUpdate "PowerCubeName"
    Information "Type in the description here ...."
    SaveMdl "\\path_to_my_file\filename.mdl"
    

    Now what I need to figure out is how to get automatic dates in here So in my Description I need to populate said description with a paid_thru_YYYY_MM date.

    At the time I'm building these cubes it will be last month as the paid thru date. Then once a quarter I will need to update another series of dates for the dates of service YYYYMM through YYYYMM; so currently it is 201504 thru 201705 paid thru 201705

    What I am thinking is there must be a way to define dates based off of to_date() or now() or something like that and then pass those parameters off into the description. If anyone knows how to do this I'd love some hints. Otherwise, I'll keep plugging away on trial/error.