1 Reply Latest reply on Sep 26, 2013 4:06 AM by Prashant Sharma

# Date Format in Slider :

We have a requirement to show the date format in Slider as yyyy\\Qq\Www Eg: 2013 Q1 W10 . This is achieved by using the date format. But here the catch is I want the Week to restart from 1 after every 13 weeks . Eg :After the week -2013 Q1 W13 , I should show next week as -2013 Q2 W01 instead of -2013 Q2 W14. Is there a solution for this.

• ###### 1. Re: Date Format in Slider :

Hi Angel,

I wanted to know that in which quarter value is coming when week is >52? However following calculation will help you:-

if len('W'+datename('week',[Order Date])) = 2 or right('W'+datename('week',[Order Date]),2) <= '13' then

(datename('year',[Order Date])+' '+'Q1'

+' W'+datename('week',[Order Date]))

else if right('W'+datename('week',[Order Date]),2) > '13' and right('W'+datename('week',[Order Date]),2) <= '26'

then (datename('year',[Order Date])+' '+'Q2'

+' W'+datename('week',[Order Date]))

else if right('W'+datename('week',[Order Date]),2) > '26' and right('W'+datename('week',[Order Date]),2) <= '39'

then (datename('year',[Order Date])+' '+'Q3'

+' W'+datename('week',[Order Date]))

else if right('W'+datename('week',[Order Date]),2) > '39' and right('W'+datename('week',[Order Date]),2) <= '52'

then (datename('year',[Order Date])+' '+'Q4'

+' W'+datename('week',[Order Date]))

else if right('W'+datename('week',[Order Date]),2) > '52'

then (datename('year',[Order Date])+' '+'Q5'

+' W'+datename('week',[Order Date]))

end end end end end

Just put this in slider by creating a parameter & use this for all the calculations. If someone is having better calculation then please update this formula.

Warm Regards,

Prashant Sharma - India | LinkedIn