Skip to content

Exporting All global codes from P6 to Excel

Luke BarfordMember for 10 years 5 months
Created
8
8
0

Hi ,

Is there a way of exporting all global codes from P6 to excel or similar? 

I need to review all codes in system for a clear out.

I have run a report in p6, it does give me what i need but will not in the fomrat i need .

Any body have any experieince of using Gateway for this?is it possible?

8 replies

Oldest first
  1. 0
    Zoltan Palffy ·

    1st from the report group I

    1st from the report group I would run report CV03 Activity Code Value

    then is that is not what you want you can see of the global codes but do not know which project is using any of them 

    However there is a sql script to run to delte unused global activity codes

     Log into your P6 database as privileged user (ex: privuser):

    b. Run below script

    Please take a backup of the database before running delete scripts.

     

    --------------------------------------------------------------GLOBAL ACTIVITY CODES--------------------------------
    -Before deleting unused global actvitiy child code
    SELECT count(*)
    FROM actvcode
    WHERE actv_code_type_id IN
      (SELECT actv_code_type_id FROM actvtype WHERE actv_code_type_scope='AS_Global'
      )
    AND actv_code_id NOT IN
      (SELECT actv_code_id FROM taskactv
      );
      /

    --Delete the unused global actvitiy child code
    DELETE
    FROM actvcode
    WHERE actv_code_type_id IN
      (SELECT actv_code_type_id FROM actvtype WHERE actv_code_type_scope='AS_Global'
      )
    AND actv_code_id NOT IN
      (SELECT actv_code_id FROM taskactv
      );
      /
     
      commit;
      /
     
    --Display the count of unused global actvitiy child code after deletion
    SELECT count(*)
    FROM actvcode
    WHERE actv_code_type_id IN
      (SELECT actv_code_type_id FROM actvtype WHERE actv_code_type_scope='AS_Global'
      )
    AND actv_code_id NOT IN
      (SELECT actv_code_id FROM taskactv
      );
      /

  2. 0
    Santosh Bhat ·

    You can click on the activity

    You can click on the activity code value list, press CTRL+A to seelct all, then copy the full list from P6 and paste them into excel. But you'll need to do this one code at a time.

  3. 0
    Santosh Bhat ·

    __Duplicate Post__

    __Duplicate Post__

  4. 0
    Steven Auld ·

    Zoltan,How does that SQL Code

    Zoltan,

    How does that SQL Code handle Activity Codes that are held in a hierarchy style list?

    If a parent code value is not directly assigned then it will not appear in the TASKACTV table & the SQL script will then delete the parent even if the child codes are used in some projects. 

    Would you not also need to check that it does not appear in the parent_actv_code_id field of the ACTVCODE table?

    Regards,

    Steve

  5. 0
    Luke Barford ·

    Thanks all, I have found in

    Thanks all,

     

    I have found in P6 EPPm  Under the Administration>Enterprise Data there is an Import/Export Enterprise Data

    This gives a deatioled report into excel for everything.

     

     

  6. 0
    Zoltan Palffy ·

    then just run the 1st part

    then just run the 1st part each part explains what it is doing

  7. 0
    Joel Roberts ·

    Hi Luke,Glad to see you

    Hi Luke,

    Glad to see you worked it out. Hope the help from the fellow forum members helped. I just wanted to comment on and let you know of two apps that might help your process after the export. 

    • ScheduleReader - can help you preview the XER (or XML, XLS) file and easily see which cata is contained within. 
    • ScheduleCleaner - can help you remove (clean) categories of project data. It also has a convert Global to Project data option for calendars and activity codes.

    Both apps offer a 15-day free trial period.

    Regards

  8. 0
    Zoltan Palffy ·

    here is another sql query to

    here is another sql query to run to see what codes are not being used

    SELECT PCATVAL.proj_catg_id AS CodeValue_id, PCATVAL.proj_catg_short_name AS Project_Code_Value_Name,PCATTYPE.proj_catg_type_id AS Code_id, PCATTYPE.proj_catg_type AS Project_Code_Name
    FROM PCATVAL JOIN PCATTYPE ON ( PCATVAL.proj_catg_type_id =PCATTYPE.proj_catg_type_id)
    WHERE PCATVAL.proj_catg_id NOT IN (SELECT DISTINCT PROJPCAT.proj_catg_id FROM PROJPCAT);

Log in or join to reply

ProjectControls.com is free to join. Members can post questions, reply, vote and follow discussions.

Existing members: your original username and password still work. Forgot password?