Alteryx Designer Desktop Discussions

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

IF(AND( help

RoisinTM
5 - Atom

Hello. I need help translating the following from Excel to Alteryx

 

=IF(AND([@[Date agreed to recruit target number of patients]]="", [@[Total Number of Patients Recruited At The Agreed Target Date]]<>""),"Yellow","")

 

Tried a few things, this being the most recent (tried isempty too): 

 

IIF( isnull([Date agreed to recruit target number of patients]) and !isnull([ Total Number of Patients Recruited At The Agreed Target Date]), "0", "False") 

 

Edited to add: the 'true' outcome in my workflow would be highlighting the cell in yellow.

 

Any help would be appreciated.

6 REPLIES 6
binuacs
20 - Arcturus

@RoisinTM Can you try isEmpty() function

 

IF isEmpty([Date agreed to recruit target number of patients]) 
AND isEmpty([Total Number of Patients Recruited At The Agreed Target Date]) Then 'Yellow'
Else ''
EndIF
​

 

Luke_C
17 - Castor

Hi @RoisinTM 

 

Seems to work as expected, isempty would also work. You do have a leading space in 'Total Number of patients...' in your formula so maybe that's the issue?

 

If you're expecting cells to be highlighted you would need to put a row or column rule in a table tool to do that.

 

Luke_C_0-1659362881566.png

 

RoisinTM
5 - Atom

Thanks Luke_C and binuacs, appreciate the swift responses. No solution yet... but your replies at least tell me I'm not doing anything completely wrong.

 

I am using the column rules formatting box, and I have tried isempty too - leading spaces are part of the raw data I'm looking at so no issues there.

 

I'll keep plugging away. Thanks again.

Luke_C
17 - Castor

Hi @RoisinTM 

 

Can you provide some sample data and the workflow you're using? Or screenshots of the tool configuration?

RoisinTM
5 - Atom

Figured it out - went back through and made sure all my data types were correct and ended up with this, and it worked:

 

IF IsNull([Date agreed to recruit target number of patients]) and !isnull([ Total Number of Patients Recruited At The Agreed Target Date]) THEN 1 ELSE 0 ENDIF

 

Again, appreciate the help.

binuacs
20 - Arcturus

@RoisinTM the isempty function should also work, I updated the logic

IF isEmpty([Date agreed to recruit target number of patients]) 
AND !isEmpty([Total Number of Patients Recruited At The Agreed Target Date]) Then 'Yellow'
Else ''
EndIF

 

Labels