Substring Commands in Primavera P6 Client
P6 has three substring commands that can be invoked from within Global Change
Very few people realize that there are substring commands available in the P6 Global Change function (available in the P6 Client only).
Recently in a LinkedIn P6 group, a member was asking for help in renaming an activity UDF assignment. He had a large number of activities that he needed to change the UDF prefix on because of a plant renumbering. He had an existing UDF called Equip_ID and he needed to remove whatever the first character is and replace it with a ‘2’.
P6 has three substring commands that can be invoked from within Global Change: Substring (Parameter, start character, end character), Leftstring (Parameter, character) and Rightstring (Parameter, character). P6 also has the ability to use a UDF as a temporary variable or holding place to store a value and I can use an Ampersand (&) to concatenate two strings together.
Let’s look at how we can use these three functions together to change the first character of every UDF:
- I need to strip the first character of the existing UDF. To do this, I will use the Substring(Equip_ID, 2, 255). This will leave me with a 254 character UDF.
- I can write the UDF value into another UDF to hold the value (I will use user_text1 but you can use any UDF of type Text)
- I can then concatenate the newly shortened value with the new prefix – a ‘2’.
Here is what it looks like in P6:
The Global Change will execute the first line to shorten and store, and then concatenate a ‘2’ with the shortened string.
Now, if we want to get really fancy, we could do it all in one line:
As always, make sure you back up your project before running a Global Change for the first time and make sure that you actually check the log file before committing your changes.
About the Author
Ian Nicholson, P.Eng. - VP Solutions
As our VP Solutions and a Lead Risk and Implementation Specialist, Ian leads Emerald’s functional consulting group. With over 20 years of international experience in varied fields and roles from manufacturing, heavy civil construction, pharmaceutical plant construction, hospital projects and oil and gas capital and turnaround projects, Ian brings a wealth of project knowledge to all of our clients.
A visionary in the world of CAPEX, maintenance and turnaround planning processes, Ian has lead many of our large clients through their integration projects between ERP/EAM systems and Primavera products. Some of his integration success stories include Suncor Energy SAP to Primavera integration, BP Maximo to P6 integration, implementation of P6 at the Ontario Power Authority as well as the integration of Primavera Contract Manager with Oracle Financials at Capital Health Authority and Vancouver’s Rapid Transit Project 2000. Other major clients include Milwaukee Metropolitan Sewerage District, Shell Canada and Shell Global Solutions.
Ian has conducted Monte-Carlo risk analysis on CAPEX and turnaround projects for Shell Canada, Suncor Energy, Husky Energy and Bruce Power. He believes that successful Monte Carlo application is a process, not just a tool and has spoken at a number of events on the correct application of risk analysis.
When not assisting clients with their projects, Ian unwinds by riding his BMW motorcycle, listening to music or dragging his kids on long hikes.