David Edelman Posted February 12 Share Posted February 12 Trying to do a rollup calculation on an existing asset tree from PI AF, but I can't get the roll_up_parameters value to be something that the engine recognizes. DCS_Cont_Tree = spy.assets.Tree(data = '0EE7E6A5-A74E-EEF0-AF7C-06C2A34ADF5A') DCS_Cont_Tree.insert(name = "PV Range High", formula = '$signal_a + $signal_b', formula_parameters = {'$signal_a' : 'SP', '$signal_b': 'PV_Hi_Deviation'}, parent = 4) DCS_Cont_Tree.insert(name = "PV Range Low", formula = 'max($signal_a - $signal_b, 0)', formula_parameters = {'$signal_a' : 'SP', '$signal_b': 'PV_Lo_Deviation'}, parent = 4) DCS_Cont_Tree.insert(name = "Too High", formula = '($signal_a > $signal_b).merge(0min).removeShorterThan(10min)', formula_parameters = {'$signal_a' : 'SP', '$signal_b': 'PV Range High'}, parent = 4) DCS_Cont_Tree.insert(name = "Too Low", formula = '($signal_a < $signal_b).merge(0min).removeShorterThan(10min)', formula_parameters = {'$signal_a' : 'SP', '$signal_b': 'PV Range Low'}, parent = 4) DCS_Cont_Tree.insert(name = "Nonconforming", formula = '$signal_a or $signal_b', formula_parameters = {'$signal_a' : 'Too High', '$signal_b': 'Too Low'}, parent = 4) DCS_Cont_Tree.insert(name = 'Unit Total', roll_up_statistic = 'Counts', roll_up_parameters = '/.*x.*/ >> Nonconforming', parent='Unit_??') For the last command I get "Roll up parameter "/.*x.*/ >> Nonconforming" does not match any items in the tree." I have tried various types of regex that I know of and nothing has worked. I have also tried creating "Nonconformance" as a signal with no luck. My tree looks like this The children of the Unit_XX level have similar names, but not quite the same. The only thing that is definitely the same among them is the presence of an 'x'. There could be 3 or 4 characters before the x and 5-6 characters after the x. Some of the Unit_XX members have no children in this AF asset tree. What am I missing? Thanks, David Link to comment Share on other sites More sharing options...
Solution Kristopher Wiggins Posted February 12 Solution Share Posted February 12 Hi David, In my testing on a subset of your tree, the insertion worked when removing the forward slashes from the roll_up_parameters. If this doesn't work for you it may be easier to work through it together over an Office Hours session. DCS_Cont_Tree.insert(name = 'Unit Total', roll_up_statistic = 'Counts', roll_up_parameters = '.*x.* >> Nonconforming', parent='Unit_??') Link to comment Share on other sites More sharing options...
David Edelman Posted February 13 Author Share Posted February 13 Hi Kris - I worked with Katie P. during office hours and it seems that the error message was getting thrown because my Unit_00 had no elements under it, but the rollup was created correctly for those Unit_XX branches that did have elements under them. It seems it was just a warning message. Thanks, David Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now