Alteryx Designer Desktop Discussions

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

How to update a date from Excel to a Fraction in Alteryx

jstaker
5 - Atom

Hello,

 

I bet I am not the only one that has struggled with this, but I cannot find any answers when searching the community. I have workflow that uses a CSV input - the CSV automatically updates a column called "pack size" to a date before inputted into Alteryx. The pack size is really a fraction like "6/4" which represents 6 boxes with 4 units.

 

See snip below:

Capture.PNG

 

How can I reverse the date function of the CSV? I want to see "6/4" not JUN 4.

 

After I get the fraction back in the field I would also like to separate the field where the "/" is and multiply the two numbers together to make the field "24". I appreciate any help you all can provide! 

 

Thanks, Jordan!

3 REPLIES 3
neilgallen
12 - Quasar
A formula tool using Datetimeformat along with datetimeparse is a likely answer here. The field is likely a string, so we need to parse the relevant parts and then build back up in a particular format.

In this case:
datetimeformat(datetimeparse([PACK],”%d-%B”),”%m/%d)

The parse takes the string and identifies which parts are months and dates, and then formats the date in the desired manner using datetimeformat.
danilang
19 - Altair
19 - Altair

Hi @jstaker 

 

Building on @neilgallen's suggestion, here's a workflow that converts the date to a fraction and then performs the final multiplication you need

 

WF.png

Giving

 

Results.png

 

 

Dan

jstaker
5 - Atom

This performed the function I needed to change the date back to a fraction.

 

Thank you @danilang and @neilgallen 

 

 

Labels