cancel
Showing results for 
Search instead for 
Did you mean: 

Assign ID using Assignment in MDM

former_member202443
Participant
0 Kudos

Dear all,

How to make an Assignment in MDM to check if customer ID is null then assignment the MAX number of customer ID in the system and assign MAX + 1 to a record where Assignment is applied.

*Customer ID field is Integer in the repository

Regards,

Naeem

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Naeem,

There is no way to find out the max no. of customer id, as MDM assignments does not support the concept of loops.

Work around could be, you can use an autoid to keep track of the max no of customers.

if(is_null(customerid),max,customerid)

Hope it helps.

Thanks,

Minaz

former_member202443
Participant
0 Kudos

Hi Minaz,

As you said Assignments does not follow loop concept. Functionaly it will check only that record where this assignment is applied to. If this record has null customer ID. It won't get MAX number out of this record because it is null. So, we can get maximum number out of table.

Your given expression does not work either because MAX(PARAMETER) is required.

Only max does not work in expressioin window of Assignments.

Is there any method to assign an auto number if the customer ID is found null in the assignment expressions?

e.g. IF(IS_NULL(CSTID),AUTOID,CSTID)

Is it possible to use AUTOID kind of thing here.

Regards,

Naeem

Former Member
0 Kudos

Hi Naeem,

That is what I exactly meant when I said "Work around could be, you can use an autoid to keep track of the max no of customers." Here max is a field which is of type auto id.

You need to create this field in console and specify the data type as auto id.

if_null((cust_id),auto_id_max,cust_id)

Hope it helps.

THanks,

Minaz

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I do agree there is no direct way to assign counter loop to check max customer id then assign it to blank customer Id + 1. But there are some workarounds. I have not faced this situation so far but reading this link Generating the Number may help you it talks about building custom java application, using Qualified range and using Workflow. Just for Practice I tried using workflow only but not able to get desired result if you able to do so please share with us. Its good if u can make custom Java application.

Its quite achievable through Qualified Range which take care for iterating customer id but only drawback you would find this Customer id in Edit Key Mapping by right clicking on the record morever find this Customer ID only after syndicating records.

Please refer this link:

http://mdmdev.blogspot.com/2008_05_01_archive.html

Best Regards,

Mandeep Saini

former_member208981
Contributor
0 Kudos

Hi Naeem,

We cannot make the comparisons in MDM Assignment expressions, like we do in programming languages to find the maximum value and storing it in a variable and the using it further etc.

You can try the above workarounds. Other than that, you can check if there are null values for the field and assign the required value manually.

Hope it helps.

Thanks.

Priti

Former Member
0 Kudos

Hi Naeem,

there is no way in MDM to assign the MAX value of a number of main table. What you can do is to syndicate the value, add a number through PI and then import the record. Therefore the solution may be outside MDM. You can also try to create a scheduler task that read all the record in the repository finding the max value and writing the next value in the new record.

Hope this help you.

Regards,

Vito