cancel
Showing results for 
Search instead for 
Did you mean: 

Auto Assign Domain Based on the Strings in the Column names

former_member193591
Participant
0 Kudos

I have created domains and I have to assign them to all the columns in the PDM; Do I have to assign them individually or do we have an autoassign option or script to auto assign them in the Power Designer. Or can I load Domains through excel import like how we load the usual datatypes. I am using latest version now.

I am able to load the datatypes through SQL or Excel, however I am unable to figure out how to auto assign or load tables with domain information.

Also can someone provide me with the excel that I can maximum use to create a model; I did get the basic one from the PD installation directory. I am able to create Tables, column and joins using this.

Accepted Solutions (1)

Accepted Solutions (1)

c_baker
Employee
Employee
0 Kudos

What about just using the 'List of Columns' from the 'Model' menu, adding the 'Domain' column and then sorting and filtering to arrange the columns as you like?

Then you can multi-select and change the columns to the same domain all at once.

It really depends on whether you want to take the time to do this programmatically (e.g. via VBScript) and make it repeatable, or you just want to do it only once or twice.

Chris

GeorgeMcGeachie
Active Contributor
0 Kudos

A List Report would provide a repeatable, stable, export mechanism for Arvind to use - if the choice of domain is as simple as 'the domain that has the same name as the last word in the column name', use VLOOKUP in Excel to auto-populate the domain name, and use Excel import to import the amended columns.

GeorgeMcGeachie
Active Contributor
0 Kudos

That's OK for a one-off process, but I think a model check would be better, that would report columns where the class word (such as 'name') doesn't match the assigned domain - include an auto-fix capability if you want to.

former_member193591
Participant
0 Kudos

Apologies I was out of town on a different business;

Thank you George. Once we load domains into Excel against the columns, how do we import. there isn't an entity as domain which takes these Domains from Excel to populate the domain in PD. Like how you assign Comuns names to 'column names' table names to 'table' and code to 'code ... there isn't a domain that helps PD to look for in Excel. is there a seperate excel template that needs to be used to populate or any excel with the heading that is mapped to PD while importing would work.

& How do we include an auto-fix capability ... to fix auto correct domain, or anything that needs to be fixed    

GeorgeMcGeachie
Active Contributor
0 Kudos

You can create domains in the same Excel import if you want to - use a sheet called 'Domain'. Take a look at the Options for your Excel import - by default it will create referenced objects if they don't exist, including Domains.

There is no auto-correct for Excel import - if I were you, I'd test the import by importing into a new model and comparing it with the current model to see the effect of the import on your model.

former_member193591
Participant
0 Kudos

Thank you George; I will give it a try.

Answers (1)

Answers (1)

former_member200945
Contributor
0 Kudos

YES you can auto assign domain to each column.

To do it  you must have information on which domain assign to which column.

This information can be saved in file. Or you can create extended attribute in each column,

store domain name in there.

Then you can write script to get the information and use it to assign domain.

If you can provide more info on how you map a domain to a column, I'm happy to show you

script sample.

former_member193591
Participant
0 Kudos

I am using V 12.5 and the 16.5 trial version. Please suggest which of your option is best in 12.5; ot is it only in 16.5

former_member200945
Contributor
0 Kudos

It works for both versions.

Here is my question.

In a PDM I have domain called myDomain. There is table called Customer and it has

a column called Name. I want to assign myDomain to Name

Do you have a file to store the information? For example

Customer.Name                          myDomain

former_member193591
Participant
0 Kudos

No Phillip,

1) .... I do not and that kind of the file, and that's what I was checking /requesting. If I have a file and a sample data filled in, I will be able to figure out and use it to develop the model through the excel file.

2) ... I would also like to know if there are any VB scripts that exports the pdm into excel which would allow me to make changes and reload them back with changes to update the pdm