This formula is assigning to week. I need to understand what this is doing.
PadLeft(ToString(FLOOR(DateTimeDiff(DateTimeAdd([Datum],4-
Switch(DateTimeFormat([Datum],"%a"),7,"Mon",1,"Tue",2,"Wed",3,"Thu",4,"Fri",5,"Sat",6),"days"),DateTimeParse(ToString(ToNumber(DateTimeFormat(DateTimeAdd([Datum],4-Switch(DateTimeFormat([Datum],"%a"),7,"Mon",1,"Tue",2,"Wed",3,"Thu",4,"Fri",5,"Sat",6),"days"),"%Y")))+'-01-01',"%Y-%m-%d"),"days")/7)+1),2,"0")
//Tony
Hi @tojo, this is a Server discussion channel. But I can point you to the answer. The best way for you to understand what the expression is doing is to analyse it from inside out, breaking it into sections. Take one formula, for example DateTimeFormat([Datum],"%a"), place it on a separate formula and see the result. I also recommend to look into the documentation, there are multiple examples there on every expression.
For more information about that formula, see this post: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/DateTimeFormat-U-for-1-1-2023-returns-... and then this post: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Calculating-Week-Number-using-DateTime...
That formula is shown in the second link.