Missed the Q4 Fall Release Product Update? Watch the on-demand webinar for more info on the latest in Designer 24.2, Auto Insights Magic Reports, and more!
Free Trial

Alteryx Designer Desktop Discussions

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

Formula defaults to Else 50+

DeanoNY
7 - Meteor

Good day 

 

I have a formula that I have written and I am getting null values that default to 50+. I have tried to write is null then statement but that is not working.

There are null values in the field. 

 

Here is my formula 

 

If [Opportunity_Employees_Paid_Per_Payroll__c]<=4 then '1-4'
Elseif [Opportunity_Employees_Paid_Per_Payroll__c]>=5 && [Opportunity_Employees_Paid_Per_Payroll__c]<=9 then '5-9'
Elseif [Opportunity_Employees_Paid_Per_Payroll__c]>=10 && [Opportunity_Employees_Paid_Per_Payroll__c]<=19 then '10-19'
Elseif [Opportunity_Employees_Paid_Per_Payroll__c]>=20 && [Opportunity_Employees_Paid_Per_Payroll__c]<=49 then '20-49'
Else '50+'
Endif

6 REPLIES 6
mbarone
16 - Nebula
16 - Nebula

Your formula does not account for null values, so if a null value is encountered it will evaluate to your "else" condition of "50+".  What do you want null values to evaluate as?  

DeanoNY
7 - Meteor

I would like the null value to be 0

mbarone
16 - Nebula
16 - Nebula

0 is a number though, and all your values evaluate to a string.  Still, you can just add a line right before the 50+ line that says if IsNull([field name]),'0'

 

But again, just know that it won't be the number 0, but rather the character 0.

mbarone
16 - Nebula
16 - Nebula

Unless you mean that you want to treat a null for [Opportunity_Employees_Paid_Per_Payroll__c] as zero, and have your formula evaluate to 1-4.  Then you can change your first line of code to:
If IsNull([Opportunity_Employees_Paid_Per_Payroll__c]) OR [Opportunity_Employees_Paid_Per_Payroll__c]<=4 then '1-4'

 

 

DeanoNY
7 - Meteor

Awesome thank you for the advice and the help

mbarone
16 - Nebula
16 - Nebula

Welcome!

Labels
Top Solution Authors