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.
I don't see any issue with you if statement. Are you doing this within the LOAD statement right?
LOAD if([FieldA]='A' and [FieldB]='Y', [FieldC]) as RequiredField
All three fields need to be part of your input table, they can't reside in separate tables. Is this true?
Then, could you post your complete LOAD statement? It's hard to tell why you get the error message without seeing the full context.
UPDATE:
Field1, Field2 and Field3 are coming from the same table, Table1.
I am using this in the load of a new table:
Table2:
Load
Field1,
Field2,
Field3,
if(Field1='A', and FieldB='Y', then Field3) as [DefinedValue]
Resident Table1;
Is it possible to take two fields from two different tables and use them in a third table using Resident load?
For example,
Field1 from Table1
Field2 from Table2
Table 3:
(Should have Field 1 and Field2).
if(Field1='A' and FieldB='Y' or 'N', Field3) as [DefinedValue]
Try this:
If(Field1='A' and Match(FieldB, 'Y', 'N'), Field3) as [DefinedValue]
After you join them using JOIN functionality
DRJ DJ wrote:
Is it possible to take two fields from two different tables and use them in a third table using Resident load?
For example,
Field1 from Table1
Field2 from Table2
Table 3:
(Should have Field 1 and Field2).
No, not without using inter record functions, like lookup(). Or maybe a MAPPING.
This works in the Load script?, Sunny