cancel
Showing results for 
Search instead for 
Did you mean: 

Validation Expression

Former Member
0 Kudos

Hi All,

I am trying to write a validation expression for the following requirement but not able to succeed -

I have two fields which are qualifiers in my one of the qualified lookup table and one field called Material Number(calcualted) which is a main able field. For example name of the fields are -

Field1 - Qualifier

Field2 - Qualifier

Now I have to wirte a validation expression in which - If the Field1 = "Yes" then Field2 has to be null (This I have achieved) and if Field1 = "No" then Field2 can not be null (Done) and it should have a valid Material Number (Not able to do).

By valid material number what I mean is the number should be one amongst what all are present in the Material Number field on the main table.

Any help would be greatly appreciated.

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Try this...

IF(Qualified.Field1. = "Yes", IS_NULL(Qualified.Field2),IF(Qualified.Field1. = "No" , IS_NOT_NULL(Qualified.Field2),False))

Thanks,

Mandeep Saini

Former Member
0 Kudos

Hi Mandeep,

Your expression is not checking for my second condition i.e. for valid material number any where.

Correct me if I am wrong.

Regards

Former Member
0 Kudos

Hi,

Try this.....

IF(Qualified.Field1. = "Yes" AND IS_NULL(Qualified.Field2),TRUE, FALSE) OR (IF(Qualified.Field1. = "NO" AND IS_NOT_NULL(Qualified.Field2), TRUE, FALSE) AND IF(FIND(Qualified.Field2,Material Number), TRUE, FALSE))

Rewards if Useful.....

Thanks,

Mandeep Saini

Edited by: Mandeep Saini on Jul 31, 2008 10:25 AM

Former Member
0 Kudos

Hi Mandeep,

FIND does not parse all the values in one particular column, it only parse a particular phrase or word in one record column. Here I want to parse all the values in a column dynamically.

Regards,

Former Member
0 Kudos

Hi,

U can make a group of validations and write in each the Find operation,then u can run that group.This will check all the validations simultaneously(make group one after the other sequsntially.)

Rgds

Ankit

Former Member
0 Kudos

Hi,

I feel for check all the values in column dynamically only option left with you to change your Repository structure and it should work. for this first you create a subtable say Materials having field name say Name by default of type text which should look up into your Maintable i mean in Main table you create a field say Material Number which is look up to this Subtable Materials.

Now the syntex for find should work.

IF(Qualified.Field1. = "Yes" AND IS_NULL(Qualified.Field2),TRUE, FALSE) OR (IF(Qualified.Field1. = "NO" AND IS_NOT_NULL(Qualified.Field2), TRUE, FALSE) AND IF(FIND(Qualified.Field2,Material Number.Name), TRUE, FALSE))

you can try this in your any Demo repository first if it works you can change to your actuall repository.

But here you have to again change your Maps and whole mapping during import Manager. i hope it should work.

Rewards If Useful....

Thanks,

Mandeep Saini

Edited by: Mandeep Saini on Jul 31, 2008 12:53 PM

Former Member
0 Kudos

Hi Tony,

Validation can be written for the first condition i.e. If field1 is Yes then field2 should be null and other way round, but we cannot have a loop feature to find out the valid material numbers present in the main table.

IF(Qualified.Field1. = YesNoIndicator AND IS_NULL(Qualified.Field2), TRUE, FALSE)

Regards,

Jitesh Talreja