Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

How to check uniqueness!!

Highlighted
RRK_19
Regular Collector

How to check uniqueness!!

Hi,

 

I am having a table component with 4 columns say col1, col2, col3, col4. My requirement is, once the users have entered values in the TC, i want to check the uniqueness of col1 & col3.

 

Can anyone suggest how this can be acheieved?

 

 

Thanks,

Roopesh Kumar

6 REPLIES
Utkarsh_Mishra
Honored Contributor

Re: How to check uniqueness!!

You just want to check or you want to restrict user to enter dupliacte value in Col3.

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
RRK_19
Regular Collector

Re: How to check uniqueness!!

Hi ,

 

I want to check and restrict the user. that is, if the user enters a value which is already present in the list, a error message to be prompted. This has to be done for both Col1 and Col3.

 

 

Thanks,

Roopesh

Mohit_Agrawal
Frequent Visitor

Re: How to check uniqueness!!

Hi Roopesh,

 

If you want to check that col1 and col3 should be different then it can be done via execution step, where you can check both values in a function and display appropriate error message.

 

If you want to restrict the user from entering same values then you can change the validation of col3 such that:

select col3_value from XXXX where value != 'selected_col1_value';

 

Hope this helps!!

 

Thanks!!

Mohit Agrawal

::Click KUDOS if this helps!!

RRK_19
Regular Collector

Re: How to check uniqueness!!

Hi,

 

I am not sure if you got my question correctly, anyways i will explain.

 

for eg:

Col1                        col3

1                                A

2                                B

3                                C

5                                R

6                                T

 

my requirement is, firstly the values in Col1 shouldn't repeat and also Col3 shouldn't repeat.

 

For each entry in col1 there should only be one entry in col3 and vice versa.

 

The user can enter any values (there is no pattern enforced) in both columns.

So could please tel me, how to achieve using a function? I am trying but not getting the results.

RikardSeger
Occasional Contributor

Re: How to check uniqueness!!

Maybe you could do a check like this:

"SELECT COUNT(*) FROM TABLE_X WHERE VALUE1 IN(COL1) OR VALUE2 IN(COL3)"

where VALUE1 and VALUE2 are input values from the user.

 

Result should be 0 if values are unique and ok to add

 

Regards Rikard

Utkarsh_Mishra
Honored Contributor

Re: How to check uniqueness!!

Modify the validation of Col3 and include the condition such that it restricts the list i.e. it does not display the value which is already selected in Col1.

This can be done via token i.e. (include this condition in validation SQL)

where parameter_xyz <> [TE.VP.<Col1_token>]

Secondly create a rule on field change of Col1, i.e.
- Null the vlaue of Col3 when there is field change on Col1.

This way there won't be any duplicate value in Col1 and Col3.

Alternatively to display the message, simply create a UI rule and select condition when field1 = field2 the display message
Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
//Add this to "OnDomLoad" event