We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to fix a parse error on business day formula

CRogers22
8 - Asteroid

hello, I'm trying to calculate business day and using the formula below =. I'm receiving Parse Error

 

IIF([Application_Date_Regulatory]>[Appraisal_Sent_To_Applicant_Date],
Null(),
1 +
((DateTimeDiff([Appraisal_Sent_To_Applicant_Date],[Application_Date_Regulatory],"days")*5 - ([App Date]-[Sent Date])*2) / 7) +
IIF([Sent Date]==6,-1,0) +
IIF([App Date]==0,-1,0)
)

 

any help with what I'm doing wrong here? Thanks in advance

3 REPLIES 3
binuacs
21 - Polaris

@CRogers22 Make sure all your Date fields are Date data type. I am guessing the App Date field and Sent Date field are Date data type 

 

IF([Application_Date_Regulatory] > [Appraisal_Sent_To_Applicant_Date],
    Null(),
    1 +
    ((DateTimeDiff([Appraisal_Sent_To_Applicant_Date], [Application_Date_Regulatory], "days") * 5 - 
    (DateTimeDiff([App Date], [Sent Date], "days") * 2)) / 7) +
    IIF(toNumber(DateTimeFormat([Sent Date],'%w')) == 6, -1, 0) +
    IIF(toNumber(DateTimeFormat([App Date],'%w')) == 0, -1, 0)
)

 

  

ChrisTX
16 - Nebula
16 - Nebula

Can you post a workflow including sample data?  The data types are important here, and we can't determine which data type each field is.

 

For example:  is [Sent Date] a Date data type?   If yes, you can't use [Sent Date]==6.  You would need to convert [Sent Date] to a day of the week, and use an Integer data type.

 

Chris

CRogers22
8 - Asteroid

Thank you both. easy fix.

Labels
Top Solution Authors