This feature allows you to create a numeric variable using the functions of AskiaScript. You can use it to:
To access this feature, in the edit menu select create a variable... and select numeric by script. Drag individual questions from the question list in the left-hand pane into the script window, and make use of the functions in the contextual (right-click) menu. Enter the name of the new variable in the caption box.
If we wanted to select the number of answers given to a multi-coded question, in AskiaAnalyse we might enter:
SIZE(??Q1??)
If we wanted to transform a response value into a non-answer, we might enter:
ON(??Note??=99, DK, ??Note??)
Suppose we want to assign a value to each item of the question Q1 Satisfaction, as follows:
We would enter:
On(??Q1??=1,10,7,4,0)
We would then validate our script.
If we wanted to remove the value 99 from the numeric variable Q1, with values from 1 to 99, we would enter:
On(??Q1??= 99,NR,??Q1??)
If we wanted to carry out a calculation on two numerical variables: Q1 + Q2, we might enter the following:
Sum: CVDKNA(??Q1??) + CVDKNA (??Q2??)
Note that the function CVDKNA allows you to transform the non-responses or not-askeds to 0.
Multiply: CVDKNA(??Q1??) * CVDKNA(??Q2??)
Divide: CVDKNA(??Q1??) / CVDKNA(??Q2??)
If we wanted to find the middle number of the responses given to Q1 (a multi-coded question), we might enter:
SIZE(??Q1??)