Skip to main content
Announcements
Marching toward a simplified navigation! READ ON
cancel
Showing results for 
Search instead for 
Did you mean: 
FreeBI
Contributor II
Contributor II

If & and statements combined together Dear all,

Dear all,

I am currently updating an existing application adding a couple of fields by doing a mapping in the script.

I have to test the values of some fields to apply the values for the new calculated fields but not all of my conditions seems to work. 

The script is :

NoConcatenate NewTable:

Load

*,

if(Field1 = 'Value1' and Field2 = 'Value2' , 'Value3', if(Field2 = 'Value4' , 'Value5', 'Blank')) as NewCalculatedField

Resident ExistingTable

Where WildMatch(Field3, 'Value6', 'Value7' ...)

 

I already tried the WildMatch/Match/Trim in the conditional statement and the condition on the Field2 doesn't seem to work even if I swap the order.

Could someone help please? Many thanks for your help.

Regards,

3 Replies
Or
MVP
MVP

What actual values of Field1/Field2/Field3 are in your source data? What's the expected and actual outcome?

FreeBI
Contributor II
Contributor II
Author

Dear Or, please find below the answer to your question.

 

NoConcatenate NewTable:

Load

*,

if(Step= 'S0008' and ValueType= 'VolumeDelivered', 'S-0001', if(ValueType= 'VolumeOrdered' , 'S-0002', 'Blank')) as NewCalculatedField

Resident ExistingTable

Where WildMatch(Market, 'FR', 'BE' ...);

 

stevejoyce
Specialist II
Specialist II

You need your wildcards in your wildsearch, however you want to search.

Where WildMatch(Market, 'FR*', '*BE*' ...);