Desktop User Guides > Professional > Data management scripting > Data Management reference > Data Management functions > FlipGrid
 
FlipGrid
Retrieves flipped data from SourceGrid. SourceGrid contains the originally collected data; DestinationGrid (used for OnNextCase events) stores the flipped data.
Syntax
FlipGrid(SourceGrid, DestinationGrid, QuestionNameForFlip,IterationFilter)
Parameters
SourceGrid
Type: Object
Grid question
DestinationGrid
Type: Object
Grid question
QuestionNameForFlip
Type: Text
The categorical question name for being flipped (optional).
IterationFilter
Type: None
Categorical for iteration filter. The default is NULL.
(return)
Type: Boolean
True if the flip is successful.
Notes
When DestinationGrid is a categorical loop with only one nested categorical question, and SourceGrid is a categorical loop, which might have more than one question but has at least one categorical question, the flipping only occurs for the categorical question QuestionNameForFlip. If the question name QuestionNameForFlip is not specified, the flip occurs for the first nested categorical question.
There might be some iteration categories for DestinationGrid that do not exist in the question categories for sub-questions in SourceGrid, or there might be some question categories in the sub-questions for DestinationGrid that do not exist in the iteration categories for SourceGrid. This function only flips for:
The common categories between the DestinationGrid sub-question categories and the SourceGrid iteration categories.
The common categories between the DestinationGrid iteration categories and SourceGrid sub-question categories.
If the DestinationGrid sub-question response values are null after being flipped, they are assigned to the NA category (if the question has one) unless all values, for the question being flipped in a source loop, are null in the current data row.
Example
FlipGrid(myTestLoop, MyFlipLoop, "Grid", null)
The definitions for myTestLoop and MyFlipLoop are as follows:
MyTestLoop "For the following products,please indicate your opinion?" loop
{
A "Product A",
B "Product B",
C "Product C",
D "Product D"
} fields -
(
Grid "Preference" categorical [1..1]
{
Like "Like",
LikeABit -,
Dislike "Dislike",
SourceNa - NA
};

) expand grid;

MyFlipLoop - loop
{
Like -,
LikeABit -,
Dislike -
} fields -
(
Type "Type" categorical [1..]
{
A -,
B -,
C -,
D -
};

) expand grid;
For the current record, the value for MyTestLoop is as follows:
LevelID
Grid
{A}
{ Dislike }
{B}
{Like}
{C}
{LikeABit}
{D}
{ LikeABit }
The value for MyFlipLoop is as follows:
LevelID
Type
{ Like }
{ B }
{ Dislike }
{A}
{ LikeABit }
{C,D}
FlipGrid(myTestLoop, MyFlipLoop, "Grid", {Like,Dislike})
The value for MyFlipLoop is as follows:
LevelID
Type
{ Like }
{ B }
{ Dislike }
{A}
See also
Data Management functions