JTSmith Posted May 6, 2014 Posted May 6, 2014 I have a field called Sizes, which is a check box. The options are Studio, One / One, Two / One, Two / Two, Three / Two. I'm trying to make a calculation field, export_sizes, which would be in this format: One Bed, Two Bed, Three Bed I don't care about studios. But if a record has sizes one/one and three/two, it should be calculated at "One Bed, Three Bed". If a record has sizes two/one and two/two, is should be calculated at "Two Bed". This should be simple, but I can't seem to make sense of it... Any help would be greatly appreciated.
eos Posted May 6, 2014 Posted May 6, 2014 This should be simple, but I can't seem to make sense of it... One could say that "you made your list, now lie in it", but that would be a bit harsh … Try Let ( [ l = ¶ & List ( "three/two" ; "Studio" ; "one/one" ) ; // sample data: List() represents your field; keep the pilcrow one = Case ( PatternCount ( l ; "¶one" ) ; "One Bed" ) ; two = Case ( PatternCount ( l ; "¶two" ) ; "Two Bed" ) ; three = Case ( PatternCount ( l ; "¶three" ) ; "Three Bed" ) ] ; Substitute ( List ( one ; two ; three ) ; ¶ ; ", " ) ) which for the sample value list returns "One Bed, Three Bed"
JTSmith Posted May 6, 2014 Author Posted May 6, 2014 I know, I have learned my lesson on checkboxes. Thanks for the help, worked like a charm!
Recommended Posts
This topic is 3911 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