Slickwilly9 Posted May 17, 2006 Posted May 17, 2006 I am attempting to import a spreadsheet that has a field consisting of 1s (representing true) and 0s (representing false) seperated by commas that indicate if the company as a specific feature or not. I would like for the check box to be checked if it is a 1 and unchecked if it is a 0. Is that possibe? Thanks.
Razumovsky Posted May 17, 2006 Posted May 17, 2006 I would like for the check box... Which checkbox? If you format a field pn a layout to display as a checkbox based on a custom value list of 1, it will display as checked when the contents of the field is 1. -raz
comment Posted May 17, 2006 Posted May 17, 2006 (edited) A checkbox cannot hold multiple True/False states. You will need to do one of the following: a) Break the features into individual fields, where each field is either True or False, or Set-up a value list where each feature has its own label, and check only those values that are True. Both options are going to take some work, so let us know which way you want to go before we get into specifics. --- Please clarify if this is a one-time thing, or will you be doing this repeatedly. Edited May 17, 2006 by Guest
Slickwilly9 Posted May 18, 2006 Author Posted May 18, 2006 I have a value list setup for the checkbox. It consists of 8 values. (Full Hookups, Pull Thrus, Cable TV, WiFi, Propane, Pool, Tent Sites, Cabin Rentals). The ideal thing would be to import the records currently using 1s and 0s (ex. 1,1,0,1,0,0,0,1). When I did a test export to a spreadsheet it gave me the values in the value list (which I expected) separated by a small box. I am guessing some sort of ascii something. I have almost come to the conclusion that it could be less work just to re-enter the information manually rather than spend the time trying to get it to work. I just don't want to have to enter 400 some records. Thanks.
comment Posted May 18, 2006 Posted May 18, 2006 Nah, it's a piece of cake. Assuming you have imported the 1,0... flags into a text field, and defined a value list using custom values in the same order as the flags (from left to right) Define a calculation field (result is text) = Let ( [ vList = ValueListItems ( Get (FileName) ; "YourValueListName" ) ; flags = Substitute ( ImportedField ; "," ; "" ) ] ; Case ( Middle ( flags ; 1 ; 1 ) ; MiddleValues ( vList ; 1 ; 1 ) ) & Case ( Middle ( flags ; 2 ; 1 ) ; MiddleValues ( vList ; 2 ; 1 ) ) & Case ( Middle ( flags ; 3 ; 1 ) ; MiddleValues ( vList ; 3 ; 1 ) ) & Case ( Middle ( flags ; 4 ; 1 ) ; MiddleValues ( vList ; 4 ; 1 ) ) & Case ( Middle ( flags ; 5 ; 1 ) ; MiddleValues ( vList ; 5 ; 1 ) ) & Case ( Middle ( flags ; 6 ; 1 ) ; MiddleValues ( vList ; 6 ; 1 ) ) & Case ( Middle ( flags ; 7 ; 1 ) ; MiddleValues ( vList ; 7 ; 1 ) ) & Case ( Middle ( flags ; 8 ; 1 ) ; MiddleValues ( vList ; 8 ; 1 ) ) ) Set the field's storage options to "Do not store...". Place the field on the layout and format it as a checkbox, using your value list. After you have checked the results, you can change the calculation field to a regular text field, and delete the imported field.
Slickwilly9 Posted May 19, 2006 Author Posted May 19, 2006 That worked great. Except I gave you the wrong format. The field is actually (1,0,0,1,1,0,1,1). How do I deliminate the (). Thanks.
comment Posted May 19, 2006 Posted May 19, 2006 Just change the definition of flags to: flags = Filter ( Imported ; "01" ) Hard to see why you didn't make it just "10011011" (no commas, no parenthesses, just plain 0's and 1's) from the beginning. Much easier to work with - in Excel too.
Recommended Posts
This topic is 6765 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