Forum Discussion
Adding conditional unique index column based on several criterias
- 9 years agoThank you so much, looks very useful. I will try to implement this and get back with feedback as soon as possible. Thanks again!
M or DAX is going to depend, can you post some sample data and an idea of your various tables involved? Not even sure what your unique index column is, is it just a unique integer number?
- MarianneElver9 years agoHelper III
Hi, thanks for yor quick reply!
Sure, here is a little sample. The first four columns are currently provided and will receive new records when updated, and what I need is an additional column that, by checking for customer number or email, or name and phone, provides the ID that already exists, or creates a new unique interger number:
Customer Number email Customer name Phone ID 10135000 [email protected] Benny Johnson 4329463662 1 10031030 [email protected] Pete Madsen 4346123746 2 10056030 [email protected] Pete Madsen 4346123746 2 10164001 [email protected] Donna D. Nielsen 4346272296 3 10258006 [email protected] Sanny Peterson 4346414642 4 10258032 [email protected] Sanny Peterson 4346414642 4 Hope that clarifies it, otherwise please let me know!
Thanks again,
Marianne
- Anonymous9 years agoNot applicable
Hi MarianneElver,
You can write a custom function to call the hash generate api, then input these condition columns to generate the unique code.
Regards,
Xiaoxin Sheng
- MarianneElver9 years agoHelper IIIHi Xiaoxin, Thanks for the idea, unfortunately writing a function is a little ahead of my current capabilities where I'm having trouble finding the right M-code or DAX to figure it out how to come along this challenge! But thanks anyway, Marianne