Alteryx Designer Desktop Discussions

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

flag tenured collegues

Mkhomiak
5 - Atom

i have a column with position start dates. i need to add a formula that calculates colleagues that were this the company for more than a year and flag them in the new column as tenured. is there an easy way of doing this?

3 REPLIES 3
WernerE
8 - Asteroid

Hi @Mkhomiak 

 

Any chance you can provide some sample data so anyone who wants to assist will have a better idea of the data you are working with and expected result? Just make up your own sample data. The request seems simple enough but an example may reduce any miss-understandings down the line. 😀

BS_THE_ANALYST
14 - Magnetar

@Mkhomiak you could use a logic like this:

BS_THE_ANALYST_0-1677619057126.png

IF DateTimeDiff(datetimetoday(),[Start Date],"months") > 12 THEN "tenured" else "not tenured" endif

 

Basically, if the amount of months between today and the starting date is more than 12, flag them with tenured. You can the adjust the logic for your case. 

 

ShankerV
17 - Castor

Hi @Mkhomiak 

 

Step 1: Input your dataset.

Step 2: The column which you have imported with date should be in ISO format (YYYY-MM-DD).

Else you need to convert the date from other formats like DD-MM-YYYY or MM-DD-YYYY to ISO format using the Date Time Tool.

Step 3: Using formula tool with the function datetimediff

 

IF DateTimeDiff(datetimetoday(),[ISO date],"years")>=1
THEN "Tenured"
ELSE Null()
ENDIF

 

In the above formula, as datetimetoday() is used the workflow takes today's date dynamically to calculate the tenure.

If you need to check for specific date, replace it with date in ISO format.

IF DateTimeDiff("2023-01-01",[ISO date],"years")>=1
THEN "Tenured"
ELSE Null()
ENDIF

 

ShankerV_0-1677640164305.png

 

Note: Step 2 can be eliminated if your date is already in ISO format.

 

Many thanks

Shanker V

Labels