Search the web
Sign In
New User? Sign Up
NADUG · North American Dimensions User Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Creating a better last question variable   Message List  
Reply | Forward Message #37 of 164 |
The LastQuestionAsked variable is important for tracking down issues
with running projects. It lets you find errors in the script,
identify the area of a survey where respondents are dropping out.

However, because it is a text question, you have to download the data
to do any real annalysis.

I've created a script that we can run before launching a survey. It
creates a categorical variable with a response for each questions.

------------------------------------

'This code opens an MDD and then creates a categorical variable
called LastQuestionAsked
'The categories for this question are based on the questionnames in
the survey
'and an expression is created for each category.


Dim MDM, lastQ, myExpression,myQuestion,myElement
Set MDM = CreateObject("MDM.Document")
MDM.Open("C:\TestProjects\mrStudio\mySurvey.mdd")

On Error Goto ErrorHandler

Set lastQ = MDM.CreateVariable("LastQuestionAsked","Last Question
Asked")

With lastQ
.MinValue = 1
.MaxValue = 1
.DataType = 3 'MDM.DataTypeConstants.mtCategorical
For Each myQuestion in MDM.Variables
If myQuestion.UsageType = &H0000 Then 'vtVariable = &H0000
Set myElement = MDM.CreateElement
(myQuestion.name,myQuestion.name)
myElement.Type = &H0000 ' mtCategory =
&H0000
myElement.expression
= "DataCollection.EndQuestion.Find(""" + myQuestion.name+ """)"
.Elements.Add(MyElement)
End If
Next
End With

MDM.Fields.add(lastQ)

MDM.CategoryMap.AutoAssignValues()
MDM.Save("C:\TestProjects\mrStudio\mySurvey.mdd")



ErrorHandler:

MDM.Close()





Thu Oct 26, 2006 7:35 pm

jeffreylthom...
Offline Offline
Send Email Send Email

Forward
Message #37 of 164 |
Expand Messages Author Sort by Date

The LastQuestionAsked variable is important for tracking down issues with running projects. It lets you find errors in the script, identify the area of a...
Jeff Thompson
jeffreylthom...
Offline Send Email
Oct 26, 2006
7:35 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help