The list of operators can be used in the following way:


AND, OR

Can be used in categorical computes to combine variables or parts of your expression. For example:

  • ∅11-Satisfaction=('1 - 1 Not at all satisfied,2 - 2')∅ AND ∅31-Contact=('1 - I like to be contacted')∅


This expression for answer code 1 will result in:


RespondentSatisfactionContactNew variable
131
220
3111
450

 


  • ∅11-Satisfaction=('1 - 1 Not at all satisfied,2 - 2')∅ OR ∅31-Contact=('1 - I like to be contacted')∅


This expression for answer code 1 will result in:



RespondentSatisfactionContactNew variable
1311
2201
3111
450

 


NOT

Can be used in categorical computes to exclude answer alternatives from your expression for answer 1.

  • ∅5-Gender=('1 - Man')∅ AND  NOT ∅4-Age group=('1 - 15-24')∅


This expression for answer code 1 will result in:



RespondentGenderAge groupNew variable
1111
2221
3131
424

 


NOT can be used to create a closing category "Other", but keep in mind the spaces (no space after ")" and after "NOT"):

  • NOT(∀98-BRAND∀=('1 - brand 1'))AND NOT(∀98-BRAND∀=('2 - brand 2'))AND NOT(∀98-BRAND∀=('3 - brand 3'))AND NOT(∀98-BRAND∀=('4 - brand 4'))


LIKE

Can be used when computing categorical variables to find all respondents with a specific word or sentence in an open ended variable. Text should be enclosed inside double quotes, as seen in the example below.

  • ∀98-What do you think the ad wants to tell you?∀ LIKE "brand name"


This expression for answer code 1 will result in:


RespondentWhat do you think the brand wants to tell youNew variable
1To buy more
2To remember the brand name1
3To remember it
4To buy

 


Mathematical operands (+, -, *, /) 

Can be used to create an open numeric compute in which you make calculations with your open numeric variables.

  • †98-Open numeric Value 1† + †99-Open numeric Value 2†


This expression will result in:


RespondentOpen numeric Value 1Open numeric Value 2New variable
1112
2224
3134
4246

 


Mathematical symbols (=, >, <)

Can be used when computing categorical variables to find respondents with values equal, above or below a specified limit in a numeric variable. Can also be used together with a date variable to find all respondents from, before or after a specific date.

  • (†98-Open numeric†>3) AND (♮1100000000001-Response Date♮>"2017-19-10")

Dates need to be surrounded by either double quotation marks (“) or brackets when used in an expression. Accepted formats are for example “YYYY-DD-MM” and (MM/DD/YYYY).


This expression for answer code 1 will result in:


RespondentOpen numericResponse DateNew variable
112017-18-10
242017-20-101
332017-21-10
442017-21-101

 


COUNTRESPONSE

This can be used to create a categorized variable or open numeric, but always needs a categorized variable as input in the expression (the option doesn't even appear if you have open numeric selected as your input.


You can count number of respondents, all respondents that qualify to statement get value one. 

  • COUNTRESPONSE (∅51-Country=('1 - Sweden')∅)


This expression will result in:


RespondentCountryNew variable
111
22
32
411

 


IF

Can be used to create an open numeric together with for example the function COUNTRESPONSE and Mathematical symbols to create a numeric variable based on a categorical variable. The example below shows one use of the function where respondents aware of more than 4 brands are given the value 1, all other get value 0.

  • IF (COUNTRESPONSE (∅8-Spontaneous brand awareness - In mind=('1 - Dapresy Telecom,2 - Four,3 - Swedish Telecom,4 - Sweet Talk,5 - Telecom for You,6 - Duty Calls,7 - Tel Me More,8 - DonkyCom,9 - WTC,10 - Donut Call')∅) > 4, 1, 0)


RespondentSpontaneous brand awareness - In mind (multiple)New variable (more than 4 brands mentioned)
11,2,3,4,5,71
23,4,60
32,4,5,6,71
42,4,5,6,7,8,91

 

You can use the IF statement too to recode a categorical question into an open numeric with two answers, for example:


  • IF( COUNTRESPONSE(∅19-Allows us to keep name together with results=('2 - No')∅)=1,7,3 


This counts any respondent who has a response for "No" in "consent" question and gives that a value of 7. Everything else gets 3


RespondentAllows us to keep name together with resultsNew variable
113
227
313
427

 



COUNT

Aggregate calculation including all respondents:

Give your computed numeric variable the number of respondents that have answered one or several answer alternatives in a categorical question. Optional if calculations should be made on weighted or non-weighted data. 

  • COUNT (∅1-Country holiday=('4 - Denmark,5 - Finland')∅)


RespondentCountry holidayNew variable
11,23
23,2,43
313
44,53

 


MEAN

Aggregate calculation including all respondents:

Use in a computed numeric variable to derive the mean of a categorical variable. Optional if calculations should be made on weighted or non-weighted data. 

  • MEAN (∅31-Market leader=('1 - 1 Don't agree,2 - 2,3 - 3,4 - 4,5 - 5 Agree completely')∅


RespondentMarket leaderNew variable
132,75
222,75
312,75
452,75

 


PERCENT

Aggregate calculation including all respondents:

Use in a computed numeric variable to derive the percentage of one or several answers in a categorical variable. Optional if calculations should be made on weighted or non-weighted data. 

  • PERCENT (∅5-Gender=('2 - Woman')∅)


RespondentSatisfactionNew variable
1175%
2275%
3275%
4275%

 


VALUE

This function makes it possible to convert a single choice categorical variable into a numeric variable. Each answer alternative gets the value of its factor. The IDs of the answers are not used. For example, a variable with IDs 1-5 and factors 0, 25, 50, 75, and 100 will for respondents who answered alternative 3 get the numeric value 50.


NOTE: VALUE function should be applied only to single choice categorical variables. Using it for multi choice categorical variables the respondents might get several values assigned to them, which will affect any numeric calculations performed.


The expression below shows an example where a single choice scale question is converted to a numeric variable.

  • VALUE (∅45-Purchase intention=('1 - 1 Not at all likely,2 - 2,3 - 3,4 - 4,5 - 5 Very likely')∅)



RespondentSatisfactionNew variable
110
2350
35100
4225

 


The question in this example also has an answer “Don’t know” that’s excluded from the expression. All respondents with that answer will get a missing value in the new computed variable. If you prefer to insert a 0 instead of a missing value for excluded respondents, then the additional setting “Treat missing answer as 0” can be used. 


NOTE: all respondents excluded from the expression will get value 0, no matter if it’s because they answered an excluded answer or haven’t answered the question at all.


If you use several VALUE functions in your expression a respondent will get missing value in case any of the included functions result in a missing value for that respondent. The example below shows how the difference between two scale questions can be calculated.

  • (VALUE (∅14-Performance - Quality1=('1 – 1Not at all important,2 - 2,3 - 3,4 - 4,5 - 5 Very important')∅)) - (VALUE (∅15-Importance - Quality2=('1 – 1Not at all important,2 - 2,3 - 3,4 - 4,5 - 5 Very important')∅))

Following this example let’s say respondent X answered 2 on the Performance question, but did not answer the Importance question. The value for this respondent then becomes:

  • 5 - Missing value = Missing value


RespondentPerformance - Quality1Importance - Quality2New variable
112-25
2330
35175
42
Missing


Or if setting “Treat missing answer as 0” is applied:

  • 5 – 0 = 0


RespondentPerformance - Quality1Importance - Quality2New variable
112-25
2330
35175
42
0


The letters around each variable in the expression, like ∅, ∀, ∫ and ♮, are there for the system to separate the variable types from each other.


YEAR, MONTH, DAY

Use when computing a categorical variable together with a date variable to find all respondents from a specific year, month or day.

  • (♮1100000000001-Response Date♮ YEAR=2017) AND (♮1100000000001-Response Date♮ MONTH=5)


RespondentResponse DateNew variable
112-05-20171
212-12-2017
312-11-2017
410-05-20171


If you need to have a variable called YEAR, you can create a categorical variable, with the years as answer categories and use this expression:

Answer 1 2016: ♮1100000000001-Response Date♮ YEAR=2016

Answer 2 2017: ♮1100000000001-Response Date♮ YEAR=2017

Answer 3 2018: ♮1100000000001-Response Date♮ YEAR=2018



RespondentResponse DateNew variable
112-05-20172 (2017)
212-12-20171 (2016)
312-11-20172 (2017)
410-05-20173 (2018)


An alternative way of doing this is using the YEAR function. You create an open numeric first and add the expression:


YEAR (♮1100000000001-Response Date♮)


RespondentResponse DateNew variable
112-05-20172017
212-12-20172016
312-11-20172017
410-05-20172018


In the same way you can use MONTH or DAY. For example the expression:


MONTH (♮1100000000001-Response Date♮)


RespondentResponse DateNew variable
112-05-20175
212-12-201712
312-11-201711
410-05-20175


#CurrentDate#

Can be used when computing categorical variables to replace a fixed date. The current date is updated during data activation, when computed variables are being saved/updated and can be updated daily at 00:00 automatically if this option is selected. Current date is preferably used in projects that are being updated daily to get full utility of the function. It can be inserted together with (+) and (-) operands to count days back and forward.

Example of expressions:

  • ♮1100000000001-Response Date♮="#CurrentDate#"
  • ♮1100000000001-Response Date♮<"#CurrentDate#"
  • ♮1100000000001-Response Date♮<"#CurrentDate#-7"

If current day is 2017-10-19, the examples above should contain the following data:

  • All respondents with response date equal to 2017-10-19
  • All respondents with response date before 2017-10-19
  • All respondents with response date before 2017-10-12

Just like standard dates the #CurrentDate# function need to be surrounded by double quotation marks (“) or brackets.


When deriving new date variables you can include other date variables, a fixed value or use a Numeric variable in the expression. If the data, for example, looks like the table below and the expression is Date+Qnum the date of the first respondent below would be 2019-10-12


  

Here we see an example of a real expression.


Subtracting dates

To subtract a date from the current date (data activation date) to get the number of days elapsed create an Open numeric computed variable and use the following expression:


  • "#CurrentDate#" - ♮1100000000001-Response Date♮The date variable can be any date variable in the project.


Note: CurrentDate is based on the date on which the data was activated so it is only recommended to use this function in projects with daily data uploads. The number of days value will not update automatically.


Dates in general

"Dates need to be surrounded by either double quotation marks (“) or brackets when used in an expression. Accepted formats are for example “YYYY-DD-MM” and (MM/DD/YYYY)." More examples of how time periods can be used can be found here.


Note: negative numbers can be used. Make sure you don't have quotes around them, as they are treated as normal single response answers.