Alteryx Designer Desktop Discussions

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

IF AND Statement Question

Shan_Drex12
6 - Meteoroid

Hi All, 

 

I'm having trouble with this IF AND statement that I have on excel. Check below:

 

=IF(AND(AG5="",J5="FLOAD",F5="OCPD"),M5)

 

Check out Date (AG5) = "blank cell"

 

Stock Status (J5) = "FLOAD"

 

Regular Status (F5) = "OCPD" 

 

SPEND (M5) = "140"

 

I tried using this formula below but I keep getting FALSE in the Alteryx column:

 

IF [Trailer Check Out]="" AND [Trailer Stock Status]="FLOAD" AND [Trailer Status]="OCPD" THEN [Detention Spend] ELSE "FALSE"
ENDIF

 

Your help would be greatly appreciated!! 🙂 

3 REPLIES 3
tanvir_khan
8 - Asteroid

Hi .@Shan_Drex12 

Looking at your if statement, I think the blank cell condition is not working properly. Can you please eliminate that [Trailer Check Out]=""] and test your workflow.

 

This is a sample if condition I've used in Formula tool and it's working fine.

IF (([BILL] = "HWBB" OR [BILL] = "Inter")
AND [TOTAL] > 550) OR (([BILL] = "HWBB1" OR
[BILL] = "Inter1") AND [TOTAL] > 250)
THEN "T" ELSE "F"
ENDIF

 

Thanks!

grazitti_sapna
17 - Castor

Hi @Shan_Drex12 , in order to represent a blank or null cell in alteryx you might have to use isnull(Field) or isempty(Field) function.

Something like this:

IF isnull([Trailer Check Out]) or isempty([Trailer Check Out]) AND [Trailer Stock Status]="FLOAD" AND [Trailer Status]="OCPD" THEN [Detention Spend] ELSE "FALSE"
ENDIF

 

It would be better to have a sample workflow so that we can figure out the issue if not the one mentioned above.

 

Thanks.

Sapna Gupta
RolandSchubert
16 - Nebula
16 - Nebula

Hi @Shan_Drex12 ,

 

you could use IsEmpty to check the condition for [Trailer Check Out], the function checks for NULL or blank values. If there may be a " " (space) in the cell, use an additional TRIM to remove this whitespace.

Formula would like like this: 

IF IsEmpty(Trim([Trailer Check Out])) AND [Trailer Stock Status]="FLOAD" AND [Trailer Status] ="OCPD" THEN
[Detention Spend]
ELSE
"FALSE"
ENDIF

 

Hope tihsi is helful.

 

Best,

 

Roland

Labels