ENUMERATED field question

6 posts / 0 new
Last post
ry1633
ENUMERATED field question

Can I use both text and numbers in an ENUMERATED field. What I'd like to do is this example response where I only list the text for the first and fifth options:

1. Not At All Likely
2.
3.
4.
5, Very Likely

This is the TYPE that I'm using for that set of response. It works fine, but isn't what my team wants for the instrument that I'm working on.

TYPE
...
TLike = (One (1) "Not at all Likely", Two (2),Three (3),Four (4), Five (5) "Very Likely")

FIELDS
Q31NewSurv (Q31) " How likely is it that a new locally owned retail business would survive the first three years in your community? On a scale from 1 to 5, where 1 means it's not at all likely and 5 means very likely, which number would you choose?" : TLike

Ralph Dolmans

Yes, you can do it by giving the items an empty text:

TLike = (One (1) "Not at all Likely", Two (2) "",Three (3) "",Four (4) "", Five (5) "Very Likely")

After preparing the datamodel, go to the menu Project|Datamodel Properties, and at TLike uncheck the option "Hide empty items"

fwensing
fwensing's picture
You can do this

Ryan

It is possible to set up a type definition where some of the categories have no labels.

First you need to put empty strings as the labels for the three middle categories. For example:

TYPE
   TLike = (One   (1) "Not at all Likely"
           ,Two   (2) ""
           ,Three (3) ""
           ,Four  (4) ""
           ,Five  (5) "Very Likely"
           )

Then compile your instrument in order to make sure the type is defined.

Next, you need to open the datamodel properties under the Project menu. On the Types page Locate your TLike definition under the User defined items then remove the tick against the "Hide empty items" setting. After making that change, recompile your instrument.

What you will find now, for fields that use the TLike definition, the categories 2,3, and 4 will show on screen without any category label and you can use these numbers in the answer for those fields.

The "Hide empty items" setting is the default for all enumerated types and is very nice because, when it is ticked then categories that have no labels are treated as invalid by the DEP. Your case is an exception which you can easily accommodate by removing the tick.

I hope this helps.

Fred :cool:

ry1633

Fred and Ralph,

Thank you for that help. :) that is exactly what I was looking for.

svens

Hi,

I think the easiest solution would be to declare your type as:

TLike = (One (1) "Not at all Likely", Two (2) " ",Three (3) " ",Four (4) " ", Five (5) "Very Likely")

Notice the one space texts. It works in 4.6, haven't tried in 4.8.

Sven

fwensing
fwensing's picture
OK

Sven

OK, that works in 4.8 too.

It is subtle, because if you take out the blank character and don't uncheck the "Hide emtpy items" the empty categories disappear.

Fred :|

Log in or register to post comments