Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two Fields
FieldA has two values A and B
FieldB has Y and N
FieldC has numbers.
I am trying to fetch values from FieldC based on condition on FieldA and FieldB in the Load Script as below:
if([FieldA]='A' and [FieldB]='Y', [FieldC])
If FieldA has A and FieldB has Y as values, then the column FieldC should get all the values corresponding to the condition. But I get this error saying Invalid Expression. How to achieve this in Load Script level.
if(Field1='A', and FieldB='Y', then Field3) as [DefinedValue]
if(Field1='A' and FieldB='Y' or FieldB = 'N', Field3) as [DefinedValue]
Yes, I would think so. Is it not working?
I don't see any error. But I see that the conditions are not being evaluated. The resultant field is showing incorrect values.
Can you explain your condition in plain simple English?
I need to check for a value in Field1, check for two values in Field2 ( Like A or B) and then depending on the conditions, I should display the value present in Field3 as DefineValue columm.
I hope you got it, Sunny
Check this from the help that may help you
lookup(fieldname, matchfieldname, matchfieldvalue [, tablename])
Returns the value of fieldname corresponding to the first occurrence of the valuematchfieldvalue in the field matchfieldname.
Fieldname, matchfieldname and tablename must be given as strings (e.g. quoted literals).
The search order is load order unless the table is the result of complex operations such as joins, in which case the order is not well defined.
Both fieldname and matchfieldname must be fields in the same table, specified bytablename. If tablename is omitted the current table is assumed.
If no match is found, null is returned.
Example:
lookup('Price', 'ProductID', InvoicedProd, 'pricelist')
I would think this to work:
If(Field1='A' and Match(FieldB, 'Y', 'N'), Field3) as [DefinedValue]
Would you be able to share a sample where this isn't working?
Sorry Vikram, I need to check for two values in Field2. It's not just one value in Field1. This thing doesn't work in this case.
Conditions example:
if Field1 has X
if Field2 has Y or N,
then Field3 as DefinedValue.
In this case, you maybe able to do it for one value, but I need to check for two values in the Field2
The sample data i can provide is the same examples I have been using, Sunny. My original data is too complicated and also, privacy issues. So I will try it from my end and will get back if I can't figure it out. Thanks again