in the third part of our primavera p6 databases and data cleansing series, we will show how to use the parser to clean an xer file

in the third part of our primavera p6 databases and data cleansing series, we will show how to use the parser to clean an xer file.  but if you haven’t read them go back and read: xer file parser excel utility

cleaning an xer file for import

notice: the primavera xer file parser is not an officially supported utility. it may:

  1. be prone to errors
  2. break your xer files.
  3. cause other problem you or we didn’t even think about

use it at your own risk. make lots of backups.

if you are finding that importing xer files are slow, then you might want to check out this article about pobs data.

altering or removing an xer’s activity codes

important notes about activity codes in p6 :

  • the eps activity codes need to exist in the database before you can import them, and they need to be defined in parent node where you are going to import your project, otherwise they will not be imported.
  • there is no way to import eps activity codes with a project unless you use the parser, or other tools like xer manager.
  • using p6, global activity codes can be changed to project activity codes by copying the code and re-assigning them to activities – (a lot of work!) – or you can do that in the parser by changing one line – handy!

we create a test project with three tasks; every task was assigned global code, project code and eps codes.

altering or removing an xer's activity codes

in the xer file, three tables are related to activity codes.
actvtype : activity codes
actvcode: activity code values
taskactv: activity codes assigned to activities

altering or removing an xer's activity codes
1) click on project

altering or removing an xer's activity codes
2) note here the project_id is 3734. click on actvtype.

altering or removing an xer's activity codes

what can you change?

now you can change the activity code type.as an example, we will change

test1 from global to project

3) assign the project id 3734 under proj_id, and change the as_global to as_project.

test2 from eps to project

4) assign the project id and remove wbs_id, and change from as_eps to as_project.

you can also remove all activity codes by deleting the rows in the table actvtype.

altering or removing an xer's activity codes

altering an xer’s calendars

  • p6 has three different types of calendar; global, project and resource.
  • 世界杯时间比赛时间 in p6 can be assigned either a global or a resource calendar. (not a project calendar).
  • if your project calendar inherits from the global calendar it will be exported too.

in the sample xer we used all the types of calendar to showcase what changes you can do.

altering an xer's calendars

altering an xer's calendars

notice here that project_calendar_1 inherits holidays from a global calendar – standard 5 day workweek.

altering an xer's calendars

and here, project_calendar_2 does not inherit from a global calendar.

altering an xer's calendars

a resource can use either a global or resource-specific calendar.

in the xer file, calendars are recorded in three tables:
calendar: this is the calendar dictionary

altering an xer's calendars

task : here you can find calendars assigned to activities.

altering an xer's calendars

rsrc : here you can find calendars assigned to 世界杯时间比赛时间 .

altering an xer's calendars

what can you change?

for the calendar is not a simple change of ca_base to ca_project.

calendars are complicated data for example:
if a global calendar is assigned to a resource and a task, and you want to change it to project, you have to create another copy of the global calendar as a resource calendar and assign it to the resource.
project calendars inherit only from the global calendars, so you can not simple chane the global to project.
so i think it is just better to add a prefix to all the calendars to make sure they will not clash with the existing calendars in p6 database and latter manually cleaning them in p6 client.

altering an xer's calendars

 

or when you import the xer file make sure to change the template to insert new.

altering an xer's calendars

 

why is this important?

p6 by default keeps the existing calendar, but p6 checks only the calendar name when importing.  in the case where you import a file that has the same name calendar but has different working period or holidays, p6 will assume it is the same and keep the existing, and then you end up with a different schedule.

obviously don’t uses “update existing” as it will update existing calendar and affect the existing schedule.

altering an xer’s 世界杯时间比赛时间

resource dictionaries are stored in rsrc table. notice the resource rates are stored in a separate table rsrcrate.

altering an xer's 世界杯时间比赛时间

what can you change?

it is up to you can add a prefix to the 世界杯时间比赛时间 and use the default keep existing or use the import option “insert new”. (but do not use “update exiting”.)

altering an xer's 世界杯时间比赛时间

why it is important?

when you import a schedule, p6 will check only against the “rsrc_short_name”, so if the imported schedule use the same short name “ r-2”, but different price per unit, or even the new resource is non labor and the existing is labor p6 will keep the same.

the implication is quite simple: the new imported schedule will have a different total cost.

altering an xer’s user defined fields

if you have to give only one reason to use the parser, probably it is for the udf, planners tend to use a lot of udf for temporary reason, they can be used as a calculated field in the global change, and some reason, planners use a lot of different names for the same item, for example for a bill item: billitem, pay item, id, item_number.

in the sample xer, there are four udf, three at the activity level (#before start, #before finish, bill quantity)

altering an xer's user defined fields

and one at the project level (notes).

altering an xer's user defined fields

in the xer file, udf are recorded in two tables

udftype : udf dictionary

altering an xer's user defined fields

udfvalue: udf assignment

altering an xer's user defined fields

what can you change?

you have many options:

  • you can delete udf that you don’t need ( make sure to delete all the reference in all the tables otherwise you end with orphan records, and the xer will not be imported),
  • add a prefix to those udf, so they can easily clean them later in the database.
  • map to the existing udf, ( change the name of the udf to the existing one in the database)

altering an xer's user defined fields

altering an xer’s currencies

p6 export all the currencies in the database even if they are not used by the 世界杯时间比赛时间 , it make sense to delete those unused currencies. the data is recorded into two tables:

currtype: currency dictionary

altering an xer's currencies

rsrc : currency used by the 世界杯时间比赛时间

altering an xer's currencies

the algerian dinar can be deleted as it is unused

other things you can alter

for the remaining data type (expense, project codes, issues, notebook, etc) download and have a look at the p6 database schema documentation , all tables, and tables interdependencies are detailed there.

wrap up

what else can be easier than opening a file? we do it every day instinctively, with dozen of documents (word, excel, pictures …).

p6, as any database application, is different. when you open an xer file; in reality you are importing a huge number of data into your database. if you are a standalone user, that may be not that harmful, but if it is installation shared by other planners, that’s becoming quite dangerous and inconvenient.

the fundamental issue here is that the import of an xer file brings in all sorts of global data associated with the project you’re importing. what can be worst and a pure waste of time than if someone unintentionally alters that shared calendar or resource price/unit after importing an xer file – and you’re left trying to figure out why your data has changed?

p6 is a power database application, and to maintain your database integrity, and avoid a huge waste of time and money, simple rules apply.

  • implement a draconian security policy and ensure the privilege to import xer is governed by a clear procedure.
  • limited access rights for the users – make different security profiles based on skills, planner, senior planner, etc.

the xer fileparser is a handy tool, but it is manual and complicated as you need to understand how p6 record the data. if you import project occasionally, it is a perfect little utility.  but if you deal with a lot of external schedules, you may have a look at some commercial software that does this process in an automated way. i use xer manager myself.

download

download the xer file parser excel utility here: