chuckcou Posted October 15, 2006 Posted October 15, 2006 (edited) Just moved up from calculation. It slow learning, but I am getting better each day. Anyway, I am stumped on this one. {attached coutniesexample.fp8) The details>> Two tables 1st Table>[color:red]counties([color:green]id_state,county,statecode) 2nd Table>[color:red]States([color:green]id_state,state_short) The 1st Table [color:red]counties has no info in [color:green]id_state. What I want to do is put the [color:green]id_statedata number from the [color:red]States table base on [color:green]state_short=statecode I tried an import and it just put the data at the end. I was thinking, I could do a find and replace,but that would mean I would have to do it 52 time. : Thus, I would think maybe a script, but I am not sure where to start to how to solve this problem. Some examples would be greatly appreciated. At least I can do the research on what the example is doing. :yay: coutniesexample.ZIP Edited October 15, 2006 by Guest
Søren Dyhr Posted October 15, 2006 Posted October 15, 2006 I thought I was going nuts, until I discovered that the state abreviation weren't identical in the two tables, one with tailed spaces and one without, so a scripted replace was needed using: http://www.filemaker.com/help/FunctionsRef-381.html Anyway, the issue is that such things should be copied at all, but shown in a referenced field pulled in from a relation away. --sd coutniesexample.zip
chuckcou Posted October 15, 2006 Author Posted October 15, 2006 I have been reading this morning and maybe I shoud do a script with find and replace, or a lookup? Hum, not sure? If you had two tables and you need to fill data into one of the table from the other table what would you use? Maybe this will get me looking in the right directions?
Søren Dyhr Posted October 15, 2006 Posted October 15, 2006 If you had two tables and you need to fill data into one of the table from the other table This is conceptually wrong if what we do should be categorized as a relational database. The wish with relational databases is to avoid redundance and your suggestion, is although obedient - wrong! --sd
chuckcou Posted October 15, 2006 Author Posted October 15, 2006 This is conceptually wrong if what we do should be categorized as a relational database. The wish with relational databases is to avoid redundance and your suggestion, is although obedient - wrong! --sd Søren Dyhr Thank you for the response. This solution is to easy.(expect for the trail space, sorry about that. Filemaker pro need to allow you to turn on hidden character, thus you could see the problem sooner.) I am evaluating why I didn't think of this way. It appears our post were less than a one minute apart. Thus, I am just seeing your post for the 1st time. Thanks again for the feedback. :thanks:
chuckcou Posted October 16, 2006 Author Posted October 16, 2006 Well, I found the space problem, too. I didn't want to just copy your example without understanding it. : Can you remove the space within the same field? I know I can create another field and do a trim command and it will work. But I would rather just correct the [color:green]state_short. Thus [color:green]state_short field has a space after every state>>example: CA(space character). [color:red]I want to remove the spaces after every state. Thus, I would use this function Trim([color:green]state_short). So, I tried. Under field the calculation under auto_enter, I tried Calculated Value>>>[color:red]Substitute ( [color:green]state_short ; [color:green]state_short ; Trim([color:green]state_short) ) But when I looked at the data under [color:green]state_short it still has a space. Any ideas?? :bang:
chuckcou Posted October 16, 2006 Author Posted October 16, 2006 Opps, :oops: I got it. Instead of under field, calculation, auto_enter. I did records, replace field contents and then [color:orange]Substitute ( state_short ; state_short ; Trim(state_short) ). Actually now that I write this I could have just done [color:orange]Trim(state_short) :woohoo:
Søren Dyhr Posted October 16, 2006 Posted October 16, 2006 Take a look at this script function: http://www.filemaker.com/help/Script-Steps52.html --sd
Recommended Posts
This topic is 6951 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 accountSign in
Already have an account? Sign in here.
Sign In Now