Alteryx Designer Desktop Discussions

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

Calculating Week Number using DateTimeFormat is incorrect

bobpeers
9 - Comet

Hi,

 

I'm using the formula DateTimeFormat([date],"%W") to calculate week number but it seems that the results are incorrect for the end 2016 and start 2017.

 

For example the Date 01-01-2017 was a Sunday so should be in week 52 but Alteryx shows this as being in week 00 with week 01 starting on 02-01-2017 (in dd-mm-yyyy format). Does Alteryx do this because it doesn't allow a week number to cross years? To make it correct I have to manually alter week 00 to be week 52 which feels like a hack.

 

Clipboard01.jpg

thanks,

Bob

24 REPLIES 24
Suraj855
5 - Atom

Hi John,

 

Can I get XML for the month as well.

 

Regards,

Suraj

JohnJPS
15 - Aurora

@Suraj855, please see the response from @David-Carnes earlier in this the discussion.  He's already done the Month. 🙂

TomasKozlik
5 - Atom

Hello,

 

would this work on Alteryx server if I use this XML workaround?

 

Thanks

David-Carnes
12 - Quasar

@TomasKozlik 

Yes.
You'll need to check that it's still there after upgrading.

Best,

David

 

FabioP
8 - Asteroid

Dear All,

 

I'd like to use this logic for 'Financial Year' where for example the first date of year is 2022-04-01.

Is it possible to change any part of this formula to start to count from April?

 

Ex.:

 

01/04/202252
02/04/202252
03/04/202252
04/04/202201
05/04/202201
06/04/202201
07/04/202201
08/04/202201
09/04/202201
10/04/202201
11/04/202202
12/04/202202
13/04/202202
14/04/202202
15/04/202202
Labels