Although there may be need for a 'Join' table between your Member and Number tables instead...
In order to create a relationship directly from Member to Number, and create a portal on the Member layout showing all the Number records matching Member's MultiNumber field,
those numbers must be separated by return characters instead of commas. If there is a reason why MultiNumber can not have returns instead, just create a new
calculation and base your relationship on that field:
substitute( MultiNumber; ","; "¶" )
(the return character)
If you say there are spaces in the data, try this instead:
substitute( MultiNumber; [","; "¶"]; [" "; ""])
To remove all spaces as well.
Huslik Verlag GmbH • Bgm.-Widmeier-Str. 42 • 86179 Augsburg, DE
CEO Winfried Huslik - HRB Augsburg 12386 - VAT-Id. DE127485099
Phone +49 821 565606, Fax +49 821 565001, Email email@example.com
Verify your FileMaker Pro files with FMDiff - http://fmdiff.com
FileMaker Developer Conference July 28-31 2014 • San Antonio TX
Visit my Session on Thu, July 31, 2:00pm-3:15pm, room Perwinkle
I want to use portal which is joined by memberID. And copy each of the multinumber and MemberIDinto portal raw.
Hi Khris, :-)
You haven't indicated your version but if it is 12 or 13, this script should do what you wish (please sign in to see attached file). If you are in version 11 or prior, let me know and I'll just print out the script for you.
And once you have this data properly separated, of course you will want to keep it that way. You can eventually delete the parent multinum field. If it needs adjusting, let me know.
EDITED: Of course you do not want the MemberID in the child portal ... I just place it there so you can see the results. I also did this in quite a hurry; sorry it is ugly.
Also, I realised that it would be a tad faster if you create the first child record, set the memberID and only THEN begin the loop - and Duplicate Record/Request instead of New Record. This would save setting one variable (the MemberID) in remaining child records. In this situation I doubt you'll notice the savings but if you are creating many records, one less Set Variable() CAN make a bit of difference.
multinum.fmp12.zip 67.1 K
I really appreciate your help for sample file.
That is what I want to do.
It will help me for my project.
Once again, thank you.
I have a problem with the sample file. I need to fix the script. If there is one number or first number with multi number is not copy to portal.
I think I fix the problem. Thank you for your help again.
I have been unable to break the file in any combination of entries. Can you explain why it was breaking for you? :-)
I changed filename, fieldname and table name on your sample file.
I just changed one number on your script.
Let ( string = Substitute ( MemberID::StationNumber ; [ "," ; " " ] ; [ "/" ; " " ] ) ; Trim ( RightWords ( TrimAll ( string ; 0 ; 0 ) ; WordCount ( string )-1 ) ))
Let ( string = Substitute ( MemberID::StationNumber ; [ "," ; " " ] ; [ "/" ; " " ] ) ; Trim ( RightWords ( TrimAll ( string ; 0 ; 0 ) ; WordCount ( string )) ))
Now it works as I ask to.
Thank you again.
(I attach the file which I modified on your sample file. )
Member contains MemberID, MultiNumber. (Ex. 100001 / 700001,70043,30003,32123 [MultiNumber field contains 1 thru about 10 number, it might have space after comma]
Number contain ID and Number.
Your example (to me) implied that the MemberID was also within the text string you wished to parse so I was dropping off the leftmost 'word'. So yes, if your string contains only child values then you would not need to drop off the left word. I like to know how something didn't work so I can avoid it next time. In this instance, it was miscommunication and I will ask for clarification next time. Thanks!
If you review my example, the memberID is always the first item in the list followed by frontslash, LOL.