Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Need below mentioned formula updated in Alteryx

mmustkee
10 - Fireball

Hi Team,

 

I am looking for formula ( =IF(OR(AND([@PredCarrier]=[@[Air ff ]],[@PredCarrier]<>"NULL"),AND([@PredCarrier]<>"NULL",FIND([@PredCarrier],[@program])>0)),"Y","N")

to be applied in Alteryx.

Please discard Empty value also in ( PredCarrier & Air ff  like NULL) and mark them as "N"

 

Please refer attached.

6 REPLIES 6
cjaneczko
13 - Pulsar

Try the following.

 

 

IF(([PredCarrier] = [Air ff ] AND [PredCarrier] != "NULL") 
  OR ([PredCarrier] != "NULL" AND FINDSTRING([program],[PredCarrier]) > -1)) Then "Y" else "N" endif

 

image.png

 

cjaneczko
13 - Pulsar

Sorry i just reread your requirements. Try the following.

 

IF(IsNull([PredCarrier]) and isnull([Air ff ])) then 'N' elseif(([PredCarrier] = [Air ff ] AND [PredCarrier] != "NULL") 
  OR ([PredCarrier] != "NULL" AND FINDSTRING([program],[PredCarrier]) > -1)) Then "Y" else "N" endif

 

image.png

Deano478
12 - Quasar

@mmustkee based on how you phrased that question may I ask did you at least attempt to write this expression yourself before asking for a solution?

mmustkee
10 - Fireball

@cjaneczko 

 

Apologies my result was incorrect. Please apply formula which I attached i.e. (

IF(OR(AND([@PredCarrier]=[@[Air ff ]],[@PredCarrier]<>"NULL"),AND([@PredCarrier]<>"NULL",FIND([@PredCarrier],[@program])>0)),"Y","N")

.

 

I have uploaded new sheet and result is correct. Kindly match result and advise.

 

Apologies once again.

 

Thanks for your quick response.

nagakavyasri
12 - Quasar

Try this formula:

 

if ([PredCarrier]=[Air ff] && [PredCarrier]!= 'NULL')||([PredCarrier]!= 'NULL' && FINDSTRING([Program],[PredCarrier]) > -1) then 'Yes' else 'No' endif

 

Screenshot 2024-09-16 151258.png

mmustkee
10 - Fireball

Hi,

 

Result is not matching.

 

 

If you see your screen shot and refer record "6" Air FF is not as we have in predcarrier and Program.

The condition should be as below

 

Predcarrier = Air ff and then find in Program if matches then Yes else no

 

Labels
Top Solution Authors