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!
Find more posts tagged with
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")
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