Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I noticed that using LeftWords and RightWords cuts off certain characters such as punctuation. Is there a way to not have it do this?

""" 1-" & LeftWords(IN1A, 14) & """", "")

Larry

Posted

Did some playing around with the above. One observation:

Left( IN1A, Position( IN1A, " ", 1, 14 )

It seems that it worked in my file if the text in the field IN1A started with the character (

But it did not display any of the text from IN1A if it started with a regular text character.

Any way to make it work for both ways?

LR

Posted

Hmm. Left( IN1A, Position( IN1A, " ", 1, 14 ) ) should return all text from the beginning of IN1A to the 14th space. If there is no 14th space, that would pose a problem. The presence or lack of open parenthesis should not affect the result.

Posted

Left( IN1A, Position( IN1A, " ", 1, 14 ) )

I think this assumes the length of words is exactly 14 or something. What I am after is that I want to get JUST the first 14 words of a field, regardless of how many words exist. If there is only 6 words, then I get only the 6. If there is more than 14, I only get the first 14. If the sentance starts with a non-text character, I still would like to capture that as well.

For example if the field contains:

(SR29) for exactly the same price as the discontinued SR20, SR21, SR22 and the SR23.

Then I want to capture only the first 14 words:

(SR29) for exactly the same price as the discontinued SR20, SR21, SR22 and the

And yet still have it work if the field contains a shorter phrase:

Discontinued product line

Then this is what gets captured even though it is less than 14 words:

Discontinued product line

Larry

Posted

Try Left( IN1A, Position( IN1A, " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) ). The Min determines if 14 or the number of spaces in the field is smaller and uses the lesser of the two.

Posted

Perfect...

Left( IN1A, Position( IN1A, " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) )

Now I want to add just one thing:

1. Add a "

Posted

Left( IN1A, Position( IN1A, " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) ) & "

Posted

I Appreciate all the help. This one seems to be a tough one. I added a If statement to the start and adjusted the word count to 11 to test something:

If(not IsEmpty(IN1A), "1- " & Left( IN1A, Position( IN1A, " ", 1, Min(PatternCount(IN1A, " "), 11))), "") & "

Posted

Ah, the first part needs a IN1A & " ", similar to the second part. If there are six words, there are only five spaces. So try changing the Left portion to

Left( IN1A, Position( IN1A & " ", " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) - 1 )

Posted

Left( IN1A, Position( IN1A & " ", " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) - 1 )

It is beyond me how this one is supposed to work. And I thought I had a pretty good understanding of FM

Still does not quite work.

1.If there are less than 14 words in the IN1A field, then the above calc always cuts off the last word. So if IN1A contains 7 words, the above calc only shows 6.

2. If IN1A contains more than 14 words, then the above calc does work, and only shows the first 14 words, including non-text characters as it is supposed to do.

Larry

Posted

That one finally did it. Thanks.

This one I am using in conjunction with xmChart. There is only so much room for the legends on the charts, basically 2 lines no more than 14 or so words each line. With this I can show that, and anything over that just gets cut off.

Larry

This topic is 7457 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.