The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Creating a Variable
In one of my processes, I use the aggregate operator to add up all the footage of all the rows in my data set. Once I have this, I am trying to calculate the percentage of each row's footage to this total footage. I am using the generate attribute operator for this, and have FOOTAGE/#. # represents the total footage calculated in the aggregate step that I have to manually put in to that function.
Is there a way I can assign the total footage to a variable that I can pull back into that function later? I would like to do this so I do not have to manually enter in the total footage number everytime fo reach row.
Thank you!
0
Answers
Hi Amotley,
Have you tried to 'Extract Macro' in your process? You can
(1) aggregate and find total footage
(2) extract total footage and keep it in a macro %{TOT_FOOTAGE}
to do this, you may set macro as 'TOT_FOOTAGE', macro type as 'data_value' and example index as 1 in 'extract macro' operator
(3) use 'generate attribute' to add a new attribute, say attributed named percentage and its function expression could be FOOTAGE/%{TOT_FOOTAGE}, then each row's footage devided by %{TOT_FOOTAGE} is the percentage you wanted to achieve.
I hope this heps.
YY
YY,
I tried this, but when I tried to run the process it came up with a "Undefined macro: TOT_FOOTAGE" error message.
Did I do something wrong?
Sample process
Extract Macro.rmp
https://dl.dropboxusercontent.com/u/12092138/Extract%20MACRO.rmp
For some reason I dont know, I can not upload the rmp file here (it keep complain "The contents of the attachment doesn't match its file type")