Forum Discussion
XavierFan
6 years agoQrew Cadet
With the formula you posted above - it returns the following:
So looks like it's behaving as expected? When Type = "Master", the prefix is 123, with mini being 4567890.
------------------------------
Xavier Fan
Quick Base Solution Provider
http://xavierfanconsulting.com/
------------------------------
So looks like it's behaving as expected? When Type = "Master", the prefix is 123, with mini being 4567890.
1) With Number = 1234567890, Type = "Master"
Result = 123-4567890
2) With Number = 1234567890, Type <> "Master"
Result = 1234567890
------------------------------
Xavier Fan
Quick Base Solution Provider
http://xavierfanconsulting.com/
------------------------------
- RyanStanford16 years agoQrew CaptainThat example wasn't the best... as if say it's a 34587594513 will not work out as intended, where I want it to be 345-87594513
------------------------------
Ryan Stanford
------------------------------- XavierFan6 years agoQrew CadetOk - then you'd want to change your mini line as follows - to use "NotLeft", and get the remainder of the text after excluding the leftmost 3 characters.
var number AWBLength = Length([Number]);
var number Cut = 5;
var text Short = If($AWBLength > 11,(Left(ToText([Number]),$AWBLength - $Cut)),[Number]);
var text Prefix = If([Type]="Master", Left(ToText([Number]),3),"");
var text mini = NotLeft($short, 3);
var text Result = If([Type]= "Master", $prefix&"-"&$mini,$Short);
------------------------------
Xavier Fan
Quick Base Solution Provider
http://xavierfanconsulting.com/
------------------------------- RyanStanford16 years agoQrew CaptainAs I was awaiting response, I came to the exact same solution.
Thank you very much, Xavier!
------------------------------
Ryan Stanford
------------------------------