Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I have a field string->Dog; Cat; Horse; Frog; People

I am trying to make a calculation field that will put the value within separate fields.

So I got the 1st one--Left(field;Position(field;";";1;1)-1)  This works to get the word Dog.

But my next calculation field is not working-

Left(field;Position(field;";";1;2)-1)

Of course I did not get to Third, 4th, 5th.

what am I doing wrong?  Can someone enlighten me.

Posted

Why the duplicate post? I delete the other two.

Please give us an actual example of the text.

Posted

It may be easier to flip the string. Then use GetValue ( ) to pull out the value you need. Easy if the text string is well formatted.

  • GetValue ( Substitute ( stringText ; "; " ; ¶ ) ; 1 )
  • GetValue ( Substitue ( stringText ; "; " ; ¶ ) ; 2 )
Posted

It may be easier to flip the string. Then use GetValue ( ) to pull out the value you need. Easy if the text string is well formatted.

  • GetValue ( Substitute ( stringText ; "; " ; ¶ ) ; 1 )
  • GetValue ( Substitue ( stringText ; "; " ; ¶ ) ; 2 )
Posted

Sorry Lee.  When submitting the system hung.  So after about a minute I hit Submit again.  Waited two minutes-Nothing.  did a refresh then it took it the third time after about 30 seconds.  Not sure the reason for the delay.  But the Double post is probably from me hitting Submit twice.

Posted

Hmm that not working very well.  If I have a field(call it List) with it value being "Cat; Dog; Horse; Pig"

What calculation would I use to get Dog?

What calculation would I use to get Horse?

What calculation would I use to get Pig?

If this were php I would just separate each at the ";" , and put into an array.  Lastly then call the array.  File Maker is a little different for sure.

 

Posted

Substitute ( List ; "; " ; ¶ ) will convert "Cat; Dog; Horse; Pig" to:

Cat
Dog
Horse
Pig

 

GetValue ( text ; value ) tells FM to pick the value in the supplied list. Each line in the list is a 'value' to FM.

GetValue ( Substitute ( List ; "; " ; ¶ ) ; 1 )

will return Cat ( the 1st value in the list ).

 

GetValue ( Substitute ( List ; "; " ; ¶ ; 2 )

will return Dog ( the 2nd value in the list ).

Posted

Hey Chuck,

Refreshing the page is a good way to do it, I’ve had to do it a couple of times today too. I have sent a message to Ocean Wests, I think that the site needs to be restarted. 

I’m not going to delete any duplicates yet, I want OW to see them first.

Lee

 

wow, I thought this went out 45 minutes ago. :(

Posted

Chuck,

Let’s use actual text, and not generic text. The reason is you then can adapt it to your solution quicker and sometimes the text will lead to clues in how we suggest you extract or parse it out.

Posted

Are there really spaces after every semi-colon? I would do it slightly differently:

 

Trim( getValue( substitute( yourString; ";" ; "¶");1))

  • Like 1
Posted

Thanks all Bruce, Lee, Josh.  Perfect 

Trim( getValue( substitute( yourString; ";" ; "¶");1))

I had misspelled by field number when I replaced the your String above.  All is working correctly now and is exactly what I was looking for.  get Value  was much easier.  I will have to do some homework on getValue.

Thanks again:)

 

Posted

Great. Glad it's working.

@BruceR Thank you. That is definitely a better approach. In practice that is how I would normally approach it.

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