Update to cater the following timeframe. Please let me know if there's a quicker way to do the conversion.
string_to_res(str)=>
res = iff(str == "1" , 1 ,
iff(str == "3" , 3 ,
iff(str == "5" , 5 ,
iff(str == "10" , 20 ,
iff(str == "15" , 15 ,
iff(str == "20" , 20 ,
iff(str == "30" , 30 ,
iff(str == "45" , 45 ,
iff(str == "60" , 60 ,
iff(str == "90" , 90 ,
iff(str == "120", 120 ,
iff(str == "180", 180 ,
iff(str == "240", 240 ,
iff(str == "300", 300 ,
iff(str == "360", 360 ,
iff(str == "720", 720 ,
iff(str == "D" , 1440,
iff(str == "1D" , 1440,
iff(str == "3D" , 1440 * 3,
iff(str == "W" , 1440 * 7,
iff(str == "1W" , 1440 * 7,
999)))))))))))))))))))))
res