Alteryx Designer Desktop Discussions

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

Validation Formula giving wrong comments

Ben020283
7 - Meteor

I have an Alteryx formula to validate certain columns and produce desired comments. I am getting incorrect comments for one of the validation. below is the formula.

IF ISNULL([Termination Date]) THEN "Termination Date is Blank"

ELSEIF [Termination Date] > [Ed Date] THEN

"No action needed, Termination date is future dated"

ELSEIF [Termination Date] < [St Date] AND [Result Line Amount] != 0 AND NOT ISNULL([Retro Period]) THEN

"No action required, Retro Pay"

ELSEIF [Termination Date] < [ST DATE] AND [RESULT LINE AMOUNT] = 0 THEN

"No action needed, Employee is not getting any pay in current oncycle paycheck"

ELSEIF [TERMINATION DATE] > [ST DATE] AND [TERMINATION DATE] <= [ED DATE] AND [RESULT LINE AMOUNT] = 0 THEN

"Need to check for Missing pay"

ELSEIF [TERMINATION DATE] > [ST DATE] AND [TERMINATION DATE] <= [ED DATE] AND [RESULT LINE AMOUNT] > 0 THEN

"Need to check, Employee is terminated during the pay period " +[Termination Date]

ELSEIF [TERMINATION DATE] < [ST DATE] AND [RESULT LINE AMOUNT] > 0 AND

NOT CONTAINS([Earning], "Salary Base Pay - BASE") OR NOT CONTAINS([EARNING], "Hourly - Regular - REGH") THEN

"Prior date termination receiving earning other than reg. Validate for Bonus or OTP"

ELSEIF [TERMINATION DATE] < [ST DATE] AND [RESULT LINE AMOUNT] > 0 AND

(CONTAINS([EARNING], "Salary Base Pay - BASE") OR CONTAINS([EARNING], "Hourly - Regular - REGH")) THEN

"Prior date termination receiving Reg Sal. Possible OP"

ELSE

"Need to check"

ENDIF

 

for one of the scenario i am getting comment "Prior date termination receiving earning other than reg. Validate for Bonus or OTP" can someone review the formula and highlight what's wrong.

Employee StatusTermination DateEarningRetro PeriodResult Line HoursResult Line AmountSt DateEd Date
Terminated7/1/2023Salary Base Pay - BASE 007/1/20237/15/2023
6 REPLIES 6
alexnajm
16 - Nebula
16 - Nebula

Are your dates being stored as actual dates values (i.e. 2023-07-01) or are they still strings? I would convert them to date values using three DateTime tools or a Multi Field Formula to see if that helps.

Ben020283
7 - Meteor

Thanks for prompt response.

They are in proper date format.

I copied the below from browse tool

 Semi-Monthly On-cycle 07/01/2023 - 07/15/2023 (Semi-monthly) 2023-07-14 Terminated 2023-07-01 Personal Reasons [Null] [Null] Salary Base Pay - BASE [Null] 0 0 [Null] [Null] [Null] 2023-07-01 2023-07-15 Prior date termination receiving earning other than reg. Validate for Bonus or OTP

alexnajm
16 - Nebula
16 - Nebula

If this is copied from the Browse tool, I am doubtful it's in the proper ISO date format - Alteryx only uses YYYY-MM-DD! Go ahead and double check your metadata.

Ben020283
7 - Meteor

Below is the Metadata

 

NameTypeSize
WorkerV_String255
Colleague IDV_String255
CompanyV_String255
Pay GroupV_String12
Payroll Result Pay Cycle TypeV_String255
PeriodV_String255
Payment Date/Reversal DateDate10
Employee StatusV_String255
Termination DateDate10
Termination ReasonV_String255
Leave TypeV_String1
First Day of LeaveDate10
EarningV_String255
Retro PeriodV_String255
Result Line HoursDouble8
Result Line AmountDouble8
Result Line Amount SourceV_String255
Batch IDV_String255
Payroll Input CommentsV_String255
St DateDate10
Ed DateDate10
CommentsV_WString1073741823
jrgo
14 - Magnetar

@Ben020283 

 

I believe the issue is that you're not grouping the OR conditions for that IF clause (2nd to last). You are on the last one so I'm thinking it was simply some oversight when writing the expression. 

 

IF ISNULL([Termination Date]) THEN "Termination Date is Blank"

ELSEIF [Termination Date] > [Ed Date] THEN

"No action needed, Termination date is future dated"

ELSEIF [Termination Date] < [St Date] AND [Result Line Amount] != 0 AND NOT ISNULL([Retro Period]) THEN

"No action required, Retro Pay"

ELSEIF [Termination Date] < [ST DATE] AND [RESULT LINE AMOUNT] = 0 THEN

"No action needed, Employee is not getting any pay in current oncycle paycheck"

ELSEIF [TERMINATION DATE] > [ST DATE] AND [TERMINATION DATE] <= [ED DATE] AND [RESULT LINE AMOUNT] = 0 THEN

"Need to check for Missing pay"

ELSEIF [TERMINATION DATE] > [ST DATE] AND [TERMINATION DATE] <= [ED DATE] AND [RESULT LINE AMOUNT] > 0 THEN

"Need to check, Employee is terminated during the pay period " +[Termination Date]

ELSEIF [TERMINATION DATE] < [ST DATE] AND [RESULT LINE AMOUNT] > 0 AND

NOT CONTAINS([Earning], "Salary Base Pay - BASE") OR NOT CONTAINS([EARNING], "Hourly - Regular - REGH") THEN

"Prior date termination receiving earning other than reg. Validate for Bonus or OTP"

ELSEIF [TERMINATION DATE] < [ST DATE] AND [RESULT LINE AMOUNT] > 0 AND

(CONTAINS([EARNING], "Salary Base Pay - BASE") OR CONTAINS([EARNING], "Hourly - Regular - REGH")) THEN

"Prior date termination receiving Reg Sal. Possible OP"

ELSE

"Need to check"

ENDIF

Ben020283
7 - Meteor

It worked. Have to change the validation sequence as well. Thanks for help.

Labels