Free Trial

Alteryx Designer Desktop Discussions

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

Custom Date Field based on Payroll date

Asimkz157
7 - Meteor

Hello all, I have a report that takes payroll statements from an excel file and emails them to each individual employee.  Would there be a way to add in a date field that would use a payroll date, the date the employee would get paid on.  For example, right before the email is sent I have a formula tool that creates a SUBJECT field which states 'Attached is your July's statement for payroll 9/3/2021'.  

 

Currently I have to manually update the month name and the date based on when will the employee will get their check.  The pay period is bi-weekly.  Wanted to see if there was any way to automate this. 


Thank you in advance.  

6 REPLIES 6
phottovy
13 - Pulsar
13 - Pulsar

Hi @Asimkz157 ,

 

If you have both the statement and payroll dates as fields in your data set, you can use a formula to update the subject:

 

"Attached is your " + DateTimeFormat([Statement Date], '%B') +"'s statement for payroll " + DateTimeFormat([Payroll Date], '%m/%d/%Y')

 

 

Formula tool:

phottovy_0-1629844417105.png

 

Output:

phottovy_1-1629844461276.png

 

If you are using the email tool in Alteryx, you can then select the calculated field to be the subject of your email 

phottovy_2-1629844573555.png

 

 

 

Asimkz157
7 - Meteor

Hi, thank you for replying. The problem is I don’t have a date field. I was thinking of using a text input and creating a date field. Basically manually entering in all the pay dates but I’m stuck on the next step. How can I make the process pick up the correct pay date based on when the workflow runs? For example if I run it today - in the subject the month name should be last month and pay date should be 9/3 - next month. Hope that makes sense. I confuse myself with this stuff. 

phottovy
13 - Pulsar
13 - Pulsar

That makes sense. Try the attached workflow. I use the generate rows tool to calculate all the payroll days and then a formula tool to calculate the previous month and subject (which could be combined into one formula)

Asimkz157
7 - Meteor

I might be messing something up when plugging it into my workflow.  I'm getting multiple dates in my results. 

 

Asimkz157_0-1629891838976.png

 

phottovy
13 - Pulsar
13 - Pulsar

I made a couple changes to my workflow. The one I attached generates all of the pay periods for the current year but now I added a couple tools to limit it to the next payroll date based on today's date.

 

I also added a second option that is more straightforward and uses a text input tool like you mentioned in your comment. You can just update this tool with the payroll date and it should create the subject field for you.

Asimkz157
7 - Meteor

Thank you sir, that works perfectly.

Labels
Top Solution Authors