Jump to content

This topic is 5506 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a file with values such as A1,A2,A3,A4...A200. I want to create a "Sort by" field that will contain the corresponding number of " " spaces based on the number in the value.

Ex. For A6 I want 6 spaces in my "Sort by" field.

What calculation do I need to do this.

Posted

If your field with values "A1", "A2", ... "A200" is named MyField, then you can try...

Right(" (200 or more spaces between the quotes) ";

GetAsNumber(Substitute(MyField; "A"; "")) )

Requiring a lot of spaces is a little odd. Are you sure there's not an easier way to accomplish whatever you are going for?

For example, to generate a numeric sort field you could create a calculation that returns a number like this.

GetAsNumber(Substitute(MyField; "A"; ""))

Posted

How about add leading zeros to the numeric part?

A1 --> A0001

A2 --> B0002

...

A200 --> A0200

If the code always starts with "A" you could do

SerialIncrement("A0000"; GetAsNumber(Substitute(MyField;"A";""))))

or use the old technique of prefixing zeros manually

"A" & Right("0000" & GetAsNumber(Substitute(MyField;"A";"")); 4)

Posted

I have a file with values such as A1,A2,A3,A4...A200. I want to create a "Sort by" field that will contain the corresponding number of " " spaces based on the number in the value.

Cannot be done: the "spaces method" is limited to around 100 spaces. Values above that will get identical entries in the index.

This topic is 5506 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.