I have a stored procedure that returns the following data. The problem I am having is the business users want the report to group by week and sort in Descending order. Their company week is Mon-Sun and I was using ISO_Week to calculate the week, but I found that the week was then Sat-Sun. I have listed the results with Wk and ISO_week and you can see how the week order would give me funky order. I am sure it is simple, but I am having trouble wrapping my mind around how to do the sort order. Thanks!
WK
Location Dt Cust Ct Week
2 2016-01-01 122 1
2 2016-01-02 155 1
2 2016-01-03 157 2
2 2016-01-04 179 2
ISO_Week
Location Dt Cust Ct Week
2 2016-01-01 122 53
2 2016-01-02 155 53
2 2016-01-03 157 53
2 2016-01-04 179 1
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.