Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

How to compare month in a column with file received date

SamSurya
8 - Asteroid

Hi, I have a file which I receive on any day from 1st of every month to 5th date. I have below queries:

 

1. How can I extract date on which I have received file/system date.

2. can I store it in a variable.

3. How to check if the date is between 1-5th of every month. it should give an alert if file is received after 5th.

3. Now after extracting date, I need to extract month from the date and then have to compare/ensure that the value field for current and previous months is not 0. 

Below is the sample data:

    
File Date3/4/2019  
Month ExtractedApril  
    
Data Set   
NameMonthValuesFlag (Y/N)
AJan       55,759here, the file month is April, and Jan<April then Flag=Y
BJan       58,416

Y

 

CJan       28,071Y
AFeb       68,328Y
BFeb       88,853Y
CFeb       64,532Y
AMar       33,014Y
BMar       97,231Y
CMar       27,733Y
AApr          9,765Y
BApr       91,650Y
CApr       96,848Y
AMay0

N

since Current Month is april, so have no values for May and June

BMay0
CMay0
AJun0N
BJun0N
CJun0 
4 REPLIES 4
markcurry
12 - Quasar

Hi @SamSurya , hopefully this attached workflow will help you with a few things. 

 

To extract the date on which the file was created, you can use the Directory tool to get the CreationTime.

 

You can add Constants in the Workflow configuration, but in your case I'm not sure you need to, you could use the Directory tool and Test tool to check that the date of the file not created after the 5th, see the attached example..

 

SamSurya
8 - Asteroid

Hi Mark, 

 

thank you!!! this is awsome....

 

Just one thing here, I need to fetch File date from the database where its get uploaded by a team every month any day between 1st to 5th of every month and then have to build a check that if file is received after 5th day then it should mark it as "Late".

 

I have provided the file date just as an example, in actual file, there would be no date available.

 

Please help

 

 

 

markcurry
12 - Quasar

Hi @SamSurya 

 

No problem.  I misunderstood the format of your file, often you get a report file that has header information then followed by the data, which I thought you had in your case.

 

In this case I've change the workflow to read a file C:\Temp\Sample File.xlsx, if your filename changes you can use a wildcard.    I've added the directory tool to get the creation date information, and then I add the Creation Day and Month to the Input of your file.   I'm not sure if you want to stop the workflow if the creation date of your file is after the 5th, or if you want to add a Late column.  This workflow does both so remove whichever you don't need. Hopefully that is what you are after...

SamSurya
8 - Asteroid

Thankyou.... this works for me well.. cheers

Labels