Jimakos Posted August 24, 2009 Posted August 24, 2009 Hello. My problem is something that should be a simple thing. I just need a calculation to give me the next letter from the one endeared on an other field. "a" on the first field, "b" the result of the calculation. I have tried "substitute" and "case" giving all the possible solutions, but I don't like it. Is there an other way?
comment Posted August 24, 2009 Posted August 24, 2009 Try something like: Let ( [ alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; pos = Position ( alpha ; Character ; 1 ; 1 ) ] ; Middle ( alpha ; pos + 1 ; 1 ) )
Jimakos Posted August 24, 2009 Author Posted August 24, 2009 Thank you very much. It was really helpful. I actually wanted to make a self join relationship that shows on a portal, the names starting with the letters on a global field. This was really easy (Table1:G_name <= Table2:Name), but it showed all the names from that point to the last. I wanted an "AND" relationship that finds the names from the next letter and upwards (Table1:G_name_low > Table2:Name)but I couldn't find the way to calculate the field G_Name_Low. The hard part was the one you helped. Thanks a lot..
Søren Dyhr Posted August 24, 2009 Posted August 24, 2009 Shouldn't there be a Propper( in there? Code( and Char( does the same under fm10: Char(Code("a")+1) gives b --sd
Søren Dyhr Posted August 24, 2009 Posted August 24, 2009 names starting with the letters on a global field. This was really easy (Table1:G_name <= Table2:Name), but it showed all the names from that point to the last. You need to study this template: http://www.newcenturydata.com/downloads/filter.zip --sd
Jimakos Posted August 24, 2009 Author Posted August 24, 2009 No need of Proper. Everything is in capital letters. I show the demo. I'll study it. But I thing this is easier: Case( G_Name = " "; "Ё"; Let([ char = Right (G_Name ; 1); word = Left (G_Name ; Length (G_Name)-1); all = "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩЁ"; pos = Position(all;char;1;1); next = Middle(all;pos+1;1) ]; word & next) ) This is the G_Name_Next field. Sorry for the Greek. It's a Greek program anyway : Just had a problem with the last letter of the alphabet, but solve it using the next letter of unicode. And " " and "Ё" is used on global fields to list all the names.
comment Posted August 24, 2009 Posted August 24, 2009 I wanted an "AND" relationship that finds the names from the next letter and upwards Wouldn't the same thing be accomplished simply by making the relationship < instead of ≤ ?
comment Posted August 24, 2009 Posted August 24, 2009 Shouldn't there be a Propper( in there? What for? Position() is not case-sensitive.
Recommended Posts
This topic is 5629 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