Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Community,
I've a problem. I've calculated rolling weeks a year back (52) with this formula:
=IF(WeekYear(Today())=WeeKYear(Timestamp) AND Week(Timestamp)<Week(Today()),'W-'&Week(Order.Leverdatum),
IF(WeekYear(Timestamp)=WeekYear(Today())-1 AND Week(Timestamp)>=Week(Today()),'W-'&Week(Timestamp)&' (`'&Right(WeekYear(Timestamp),2)&')'))
For all the weeks in this year, I didn't add the year in brakes, for those from last year I did. With the following result / lay-out:
However my preferrerd result is W-49, W-48, W-47 ... W-52 ('18), W-51 ('18), W-50 ('18) (newest weeks first). When I want to sort by expression date or weekyear, the sorting didn't react.
How can I sort these rolling weeks in the preferred order?
Thanks in advance.
It would appear that what you're looking for is this:
If so, I've adjusted your code to be the following where "DateField" is to be substituted with your value (perhaps "Order.Leverdatum"?)
=IF(WeeKYear(DateField)<WeekYear(Today()),'W-'&Week(DateField)&' (`'&Right(WeekYear(DateField),2)&')','W-'&Week(DateField))
Sample attached.
It would appear that what you're looking for is this:
If so, I've adjusted your code to be the following where "DateField" is to be substituted with your value (perhaps "Order.Leverdatum"?)
=IF(WeeKYear(DateField)<WeekYear(Today()),'W-'&Week(DateField)&' (`'&Right(WeekYear(DateField),2)&')','W-'&Week(DateField))
Sample attached.