Thanks, Stuart and Paul. These are all great tips.
I have removed the destroy and create commands to the Prolog.
The reason why I am needing to store strings is the following -
I am creating a model based on a concept named Facility. This model will calculate a cost of liability for the Facility.
The model is based upon several different "attributes" of the Facility. (For example, Facility Location is an attribute that influences liability cost).
I need to store these attributes in a way that strings such as Location (Area) are captured in a way that they can be displayed in a Cube View (for users to see), and used in calculations that ultimately calculate the liability cost.
I initially considered Dimension Member attributes (ones that are added using the Member Attributes pane on the right hand side of the dimension member list), but I did not see a way to display such attributes in a cube view.
Hence, I am going with an implementation that has a Dimension named Facility, and another Dimension named Facility Attributes.
They come together in a cube that is used to define the attributes for a facility. The cells within need to be strings.
I hope this is clear. If there is a different way, I would love to know.
Finally, with regard to the error I was getting, I am still getting the error, even though my variable is defined as a string, and even after I have moved the Create and Destroy commands to the prolog.
I am moving to the client tool (Architect) to see if I can resolve my issue there, and see what I am doing wrong in my scripting.
Thanks for all your help so far!
(And if you can provide me some guidance in the other post with regard to how best to deploy models to our users, that would be much appreciated!)
------------------------------
Shubho Ghosal
------------------------------
Original Message:
Sent: Mon September 09, 2019 07:09 AM
From: STUART KING
Subject: How does one reference a variable in a process script?
Good call Ryan. It doesn't make sense to destroy and recreate the dimension for each record in the data source.
@Shubho Ghosal, One more quick thought on your original question. Assuming you are using the Ti editor in Architect or Perspectives, you need to set the Contents type of the variable to determine what part of the script the variable can be used in. I think most modelers probably use the Other type, which makes the variable available everywhere in the Ti.
------------------------------
Stuart King
IBM Planning Analytics Offering Manager
Original Message:
Sent: Mon September 09, 2019 12:49 AM
From: Ryan Clapp
Subject: How does one reference a variable in a process script?
Hi Shubho I'll also add that you shouldn't need to call the destroy or create on the metadata-tab. The metadata tab runs for every record of you data source, you don't want to destroy and recreate the dimension every single time.
------------------------------
Ryan Clapp
Original Message:
Sent: Fri September 06, 2019 03:26 PM
From: Shubho Ghosal
Subject: How does one reference a variable in a process script?
I am creating a Turbo-integrator process to load data into dimensions and cubes from a data source.
I have variables created for each column of the data source (file).
I am then trying to create a dimension as a first step.
I wrote the following code in the Metadata section-
DimensionDestroy('Facility');
DimensionCreate('Facility');
DimensionElementInsert('Facility', , V_Facility_ID,'S');
I used the editor "help" to insert these parameters. V_Facility_ID is a reference to the variable that represents the column in the file that stores the data for this dimension.
However, I am getting an error:
Error at Metadata Line 3 + Syntax error on or before " , V_Facility_ID,'S' invalid string expression "
Am I doing something wrong with respect to how I call the variable? Or is this something to do with the data in the column itself?
Thanks in advance!
------------------------------
Shubho Ghosal
------------------------------
#PlanningAnalyticswithWatson