on 05-06-2008 10:42 AM
Hi
I want to generate a number for Vendor such that it is conactenation of the Region and a SequenceNumber.
Ex: For North & range 1-1000-----> N0001,N002....N0999
For South & range 1-1000-----> S0001,S0002....S0999
Similarly for East and West E0001 & W0001.
Can anyone help me in this issue.
Regards
Nagalakshmi.
daf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The short answer is you can technically achieve this by means of an assignment. You would have an Auto ID field and a table that stores the different ranges. You then sum the values of the auto ID field to the range (or concat, based on what field type you define).
However, this may not be the best approach because then your number ranges are going to have gaps in them. For example, if you have three ranges:
1000-1999
2000-2999
3000-3999
And you have one Auto ID field that increments every time you create a new record. Your assignment will add the value of the auto id field to the range when you create a new record. However, there is a problem that I will demonstrate below.
1. You create the first record and it's supposed to use range number 1. The number looks like this: 1001.
2. You create a second record and it uses range number 2. The number looks like this: 2002.
3. You create a third record and it uses range number 3. The number looks like this: 3003.
4. You now create a fourth record using range number 1. The number looks like this: 1004.
As you can see there is a gap of three numbers between 1001 and 1004. This is because the Auto ID field will increment regardless of what range you are using. This is a problem if you design your ranges to be small, because you may run out of numbers. If you are going to use this approach, then you should design your ranges to be very large.
Otherwise you need another approach. At one of my clients we solved this problem by building a custom iView in the portals which used the Java API to generate the number. We have three tables (account group, number range, number range map). The range was dependant upon the account group that was selected. Number range table stored all of the ranges. And number range map allowed you to select an account group and the corresponding number range. So when the user created a new record in the iView, our java api program would first lookup the number range mapping table and find out based on the account group which range to select from the range table (by using a key). It would then go into the range table, increment the range value and then assign that value to the number field.
That's one way of doing it. But honestly, I would recommend having your remote systems generate the number when MDM pushes the record out, and then interface the number back to MDM and store it in the key mappings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I want to generate a number for Vendor such that it is conactenation of the Region and a SequenceNumber.
Ex: For North & range 1-1000-----> N0001,N002....N0999
For South & range 1-1000-----> S0001,S0002....S0999
Similarly for East and West E0001 & W0001.
I am assuming these are two fields in Main table (not Lookup) either of type Integer or Text
Region SequenceNumber
North 1
East 999
West 1000
and you want output like N0001, E0999, W1000. So for this create a field Say KeyGeneration of Type Text in Main table of MDM Console and Set Property Calculated = Yes and in Calculation write Calculation Expression as Follow:
IF(LEN(SequenceNumber)=4,(LEFT(Region,1)&SequenceNumber),IF(LEN(SequenceNumber)=3,(LEFT(Region,1)&"0"&SequenceNumber),IF(LEN(sequenceNumber)=2,(LEFT(Region,1)&"00"&SequenceNumber),IF(LEN(SequenceNumber)=1,(LEFT(Region,1)&"000"&SequenceNumber),FALSE))))
Hope it will Solve your query,
Rewards if Useful.....
Mandeep Saini
Hi Lakshmi
we also tried similar requirement by making the field say VENDOR ID as calculated and writing some calculation expression but no success.say region is one field and we have vendor sl no as field of type text and values 0001-9999 then we can write a calculation expression for the VENDOR ID as REGION and VENDOR NO. but this means modifying the data model
MDM identifies all its records by unique MDM ID and then we have one more option of generating Key no range in console.
hope it helps
regards-
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lakshmi,
you can make this field as a calculated field and in the calculation expression write the assignment as said by Cherry.
Hope this solves your problem.
Regards,
Dheeraj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think you need to use partition field option of import manager.
Thanks
Narendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Lakshmi,
I hope you have some idea of Assignments, for you qureey, I personally think assignmnet is going to be the best solution. Try out with assignement; if you face any problem let me know..
I hope this will solve your problem.
Cheers,
Cherry.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi,
For you querry; there is small constraint which i have just checked out now; you will be getting an semi column after concating the two fields; if that's ok then you can use this, yes sure i will be trying for another best solution for it...
CONCAT(LEFT(Emp Name,1), Emp No)
I hope will find some other best alternative solution...
Cheers,
Cherry.
Hi Lakshmi,
I was trying to do the same; but yes was finding some problem; had we had some funciton like for or while we could have achieved it.. and yes if you have any feild in your table for sequence number then you can use the above formula; and here to you have a disadvantage you get a semicolon( when you concatenate two fields; i hope i have to do some more research to get some solution for this; if semicolon is ok with you then you can use that solution; Just will update you once i could find any other alternative.
Cheers,
Cherry.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.