Closed Manipulation

This section describes AskiaScript version 1, which has been superseded by AskiaScript 2.0.

 

{;} set

Use this tag to define a set. A set refers to a variable’s selected items, for example:

{2; 5; 7} refers to a set containing items number 2, 5 and 7.

{5; 8; 9; 10; 11; 12} refers to a set containing items number 5, 8, 9, 10, 11 and 12.

{5; 8 To 12} refers to the same set as {5; 8; 9; 10; 11; 12}.

Furthermore, when used on its own, this tag enables you to make reference to the Askia system "don’t know" for variables containing sets, for example:

??Q1??={}

In Askia, data contained by the following variables are sets:

_ Multi-coded closed question

_ Loop with preliminary selection

Note: a set can also contain the AskiaScript operators DK and Other, thereby referring to the Askia system codes for: "don’t know", and "semi-open responses", for example:
{Other; DK}

Has

Use this function to verify if at least one of the referenced response items is selected.

The function will examine the values of a set and compare them with those contained in its set of reference. When at least one of the response items of the set's value(s) is present in the set of reference, the function returns the value 1, otherwise it returns the value 0.

For example:

??Q1?? Has {2;3}                      

if Q1={1;2}, the function will return: 1.

if Q1={1;4}, the function will return: 0.

HasNone

Use this function to verify if none of the referenced response items are selected.

The function will examine the values of a set and compare them with those contained in its set of reference. When none of the response items of the set's value(s) are present in the set of reference, the function returns the value 1, otherwise it returns the value 0.

For example:

??Q1?? HasNone {2;3}

if Q1={1;4}, the function will return: 1.

if Q1={1;2}, the function will return: 0.

HasAll

Use this function to verify if all the referenced response items are selected.

The function will examine the values of a set and compare them with those contained in its set of reference. When all the response items of the set's value(s) are present in the set of reference, the function returns the value 1, otherwise it returns the value 0.

For example:

??Q1?? HasAll {2;3}

if Q1={1;2;3}, the function will return: 1.

if Q1={1;2}, the function will return: 0.

HasAndNoOther

Use this function to verify if at least one of the referenced response items and no other is selected.

The function will examine the values of a set and compare them with those contained in its set of reference. When at least one of the response items and no other of the set's value(s) are present in the set of reference, the function returns the value 1, otherwise it returns the value 0.

For example:

??Q1?? HasAndNoOther {2;3}

if Q1={2}, the function will return: 1.

if Q1={1;2}, the function will return: 0.

HasAllAndNoOther

Use this function to verify if the respondent answers exactly the same way as specified in this condition.

The function will examine the values of a set and compare them with those contained in its set of reference. When all these response items and no other of the set's value(s) are present in the set of reference, the function returns the value 1, otherwise it returns the value 0.

For example:

??Q1?? HasAllAndNoOther {2;3}

if Q1={2;3}, the function will return: 1.

if Q1={2;3;4}, the function will return: 0.

In

In is a shorter synonym for the IsIncludedIn function, enabling you to write:

??Q1??In{2;3}

instead of:

??Q1??IsIncludedIn{2;3}

For example:

??Q1??In??Q2??

if Q1={2;3} and Q2={2;3;4;5}, the function will return: 1.

 

??Q1??In{2;3}

if Q1={1;2;3}, the function will return: 0.

if Q1={2}, the function will return: 1.

 

{2;3}In??Q1??

if Q1={1;2;3}, the function will return: 1.

if Q1={1;2;4}, the function will return: 0.

IndexOfMax(,)

IndexOfMax( Set ,[optional] Nth value)

Use this function to return the index of the nth biggest value in a set. The "NTh" parameter is optional and is defaulted to 1.

For example:

IndexOfMax ( {10; 20; 3; 1} )

returns 2

 

IndexOfMax ( {10; 20; 3; 1} ,2 )

returns 1

IndexOfMin(,)

IndexOfMin( Set ,[optional] Nth value)

Use this function to return the index of the nth smallest value in a set. The "NTh" parameter is optional and defaults to 1.

For example:

IndexOfMin ( {10; 20; 3; 1} )

returns 4

 

IndexOfMin ( {10; 20; 3; 1} ,2 )

returns 3

Intersection

Use this function to retrieve the common values of two sets.

For example:

??Q1??Intersection??Q2??

if Q1={2;4} and Q2={3;4;7}, the function will return: {4}.

 

??Q1??Intersection{3;5;9}

if Q1={2;4}, the function will return: {}.

 

You can use this function in conjunction with "AtleastOne" or "None" functionality:

At least one with intersection :

({3;5;9}Intersection??Q1??){}

if Q1={2;4}, the function will return: 0.

if Q1={3;4}, the function will return: 1.

 

None with intersection :

({3;5;9}Intersection??Q1??)={}

if Q1={2;4}, the function will return: 1.

if Q1={3;4}, the function will return: 0.

IsIncludedIn

Use this function to verify that the values of a set are also contained in another set.

The function will examine the values of a set and compare them with those contained in its set of reference. When the set's value(s) are present in the set of reference, the function returns the value 1, otherwise it returns the value 0.

For example:

??Q1??IsIncludedIn??Q2??

if Q1={2;3} and Q2={2;3;4;5}, the function will return: 1.

 

??Q1??IsIncludedIn{2;3}           

if Q1={1;2;3}, the function will return: 0.

if Q1={2}, the function will return: 1.

 

{2;3}IsIncludedIn??Q1??           

if Q1={1;2;3}, the function will return: 1.

if Q1={1;2;4}, the function will return: 0.

Range(,)

Range(LowerBoud,UpperBound)

Use this function to span across a set's values, thereby enabling you to save time, and improving the legibility of your Askia scripts.

For example:

Range(5,15)       

refers to the same set as: {5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15}.

Size()

Use this function to retrieve the number of values contained in a set. It enables you to determine the mean number of answers given to a multi-coded closed question.

For example, if Q1 is a multi-coded closed question containing 10 response items:

Size(??Q1??)

if the respondent selects three response items, the function will return 3.

To

Use this function to specify a range of values without listing every individual value within the range, thereby saving time and improving the legibility of your Askia scripts.

For example:

{5 To 15}

refers to the same set as: {5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15}.

Union

Use this function to merge the values contained in two different sets.

For example:

{} + ??Q1??Union??Q2??

if Q1={2;4} and Q2={3;7}, the function will return: {2;4;3;7}.

 

{} + ??Q1??Union{5;10}

if Q1={2;4}, the function will return: {2;4;5;10}.

 

Note: You can also use the operator +, such as {} + ??Q1??+??Q2??.
Create your own Knowledge Base