Planning Analytics

 View Only
  • 1.  How does one create a variable for a Ti Script?

    Posted Thu September 19, 2019 11:04 AM
    I have the following type of complex concatenation I am using in a dimension attribute insertion statement (actual variable names replaced by A. B. C, and the no. of variables is actually much higher:

    DimensionElementInsert('Type Facility', '',
     'A: ' | V_A
        | ' | ' | 'B: ' | V_B 
        | ' | ' | 'C: ' | V_C,
        'N');

    I need to use the same type of concat to reference the member name so I can add attribute values for them.

    Since there are many attributes, this is getting cumbersome to copy and paste.

    I want to create a variable at the top of the script that captures the concat.

    I tried looking up User Variables in the TM1 reference I have -

    https://www.ibm.com/support/knowledgecenter/en/SS9RXT_10.2.2/kc_gen/com.ibm.swg.ba.cognos.ctm1.doc_dev_toc-gen3.html

    I went to the TM1 Turbointegrator Variables -> Turbointegrator User Variables -> String Session Variable (Variable Name)

    I get the message -

    The requested resource is not found: /support/knowledgecenter/SS9RXT_10.2.2/com.ibm.swg.ba.cognos.tm1_ref.10.2.2.doc/r_tm1_ref_stringsessionvariable.html

    I have a clue from above as to how to create the var but still don't have a complete picture with an example.

    I need to know how to set the var as well - can the docs be corrected so we have the full picture?

    ------------------------------
    Shubho Ghosal
    ------------------------------

    #PlanningAnalyticswithWatson


  • 2.  RE: How does one create a variable for a Ti Script?

    Posted Thu September 19, 2019 11:12 AM
    Once you have created the variable by using -

    StringSessionVariable('V_Name');

    You can use it in the metadata (or data) section (depending on whether it is member/cell specific) as -

    V_Name = 'A' | 'B' | etc:

    This is pretty cool - I think the docs need to be corrected to fix the link that provides an example.


    ------------------------------
    Shubho Ghosal
    ------------------------------



  • 3.  RE: How does one create a variable for a Ti Script?

    IBM Champion
    Posted Thu September 19, 2019 01:33 PM
    StringSessionVariable is not what you think it is.  You would use this for variables that you want to perpetuate after the TI has completed e.g. you may assign a user a token in one process and want to use it again in subsequent processes.

    There is no such thing as variable declaration in TM1 for standard variables to be used within TI - You merely assign them a value and they are defined and set.  If you assign a numeric, the variable will be numeric for the entire process, likewise with strings.

    ------------------------------
    George Tonkin
    ------------------------------



  • 4.  RE: How does one create a variable for a Ti Script?

    Posted Fri September 20, 2019 11:10 AM
    Ah! Thanks for that explanation. 

    Yes, I see now that I did not need the StringSessionVariable declaration - I was able to comment it out and run the script using simply a variable assignment, without declaration.

    I still don't have a solution for how to define the variable in one place and use the definition in both the Metadata and Data sections, though. This is captured in a separate thread and I don't want to mix the two issues up, so will not expect a response to this here.

    Appreciate the help!

    ------------------------------
    Shubho Ghosal
    ------------------------------