Forum Discussion
QuickBaseCoachD
10 years agoQrew Captain
This should work. Admittedly some brute force involved here, but the formula does have some repetitive elegance to it at least.
var text SOne = [Pickup Description];
var text STwo = NotLeft($SOne,"S");
var text SThree = NotLeft($STwo,"S");
var text SFour = NotLeft($SThree,"S");
var text SFive = NotLeft($SFour,"S");
var text SSix = NotLeft($SFive,"S");
var text SSeven= NotLeft($SSix,"S");
var text SEight = NotLeft($SSeven,"S");
var text SNine= NotLeft($SEight,"S");
var text STen = NotLeft($SNine,"S");
If(
Begins($SOne,"5"), "S" & Left($SOne,4),
Begins($STwo,"5"), "S" & Left($STwo,4),
Begins($SThree,"5"), "S" & Left($SThree,4),
Begins($SFour,"5"), "S" & Left($SFour,4),
Begins($SFive,"5"), "S" & Left($SFive,4),
Begins($SSix,"5"), "S" & Left($SSix,4),
Begins($SSeven,"5"), "S" & Left($SSeven,4),
Begins($SEight,"5"), "S" & Left($SEight,4),
Begins($SNine,"5"), "S" & Left($SNine,4),
Begins($STen,"5"), "S" & Left($STen,4))
var text SOne = [Pickup Description];
var text STwo = NotLeft($SOne,"S");
var text SThree = NotLeft($STwo,"S");
var text SFour = NotLeft($SThree,"S");
var text SFive = NotLeft($SFour,"S");
var text SSix = NotLeft($SFive,"S");
var text SSeven= NotLeft($SSix,"S");
var text SEight = NotLeft($SSeven,"S");
var text SNine= NotLeft($SEight,"S");
var text STen = NotLeft($SNine,"S");
If(
Begins($SOne,"5"), "S" & Left($SOne,4),
Begins($STwo,"5"), "S" & Left($STwo,4),
Begins($SThree,"5"), "S" & Left($SThree,4),
Begins($SFour,"5"), "S" & Left($SFour,4),
Begins($SFive,"5"), "S" & Left($SFive,4),
Begins($SSix,"5"), "S" & Left($SSix,4),
Begins($SSeven,"5"), "S" & Left($SSeven,4),
Begins($SEight,"5"), "S" & Left($SEight,4),
Begins($SNine,"5"), "S" & Left($SNine,4),
Begins($STen,"5"), "S" & Left($STen,4))