Tabulation

From Catglobe Wiki
Jump to: navigation, search



Tabulation

The purpose of tabulation is to enable the users of Catglobe to create diagrams similar to what can be done with the Cross Diagram Module (CDM) from the GUI but by using a script instead. These diagrams are generated dynamically and shown to the user if the script executes successfully.

The scripting language used for tabulation will be CG Script. You can find the different functions to be used in the CG Script manual.

The tabulation scripts are accessed from the Tabulation Resource List as shown below.

6909.png

Besides the usual resource list buttons you will also see a "Schedule tabulation" button, which will make sure that the script is run at some point of time in the future or with regular intervals. Another button is the "Execute" button which will make sure you get to see the report of a tabulation script straight away.

Tabulation scripting is used in combination with a choice of data cache and thus the indirect choice of an axis set.

Below is an example of a tabulation script. We have placed some notes below the script to explain how it works, but you must refer to the CG Script manual to get a complete idea of the available functions.

This Script has a data cache and axis set related that are used as input to many of the functions.

/*Table1*/

setChartType(Diagram_ChartType_Table); /*sets the chart type to be shown to be a table of any diagrams to be created onwards*/

setShowMode(Diagram_ShowModeType_Absolute); /*asks that all results shown are in absolutes of any diagrams to be created onwards*/

setDirection(Diagram_DirectionType_Horizontal); /*asks that the results of diagrams is shown horizontally of any diagrams to be created onwards*/

setWeight("Q5_SQ_2"); /*applies the column "Q5_SQ_2" as weight on any diagrams to be created onwards*/

number a = addFilter("Q5_SQ_2 > 2"); /*Adds a filter to the diagrams being created onwards that the all respondents must have the column Q5_SQ_2 > 2*/

setTotal(true); /*asks that there is no total column in the shown results on any diagrams to be created onwards*/

addQuantile(100,25); /*asks that a quantile row (with the specified numbers it is the same as a 25 percentile) is added to any table onwards created*/

addPercentile(75); /*asks that a percentile row (with 75 percentile calculation) is added to any table generated onwards*/

setMedian(true); /*asks that a median row is added to any table generated onwards*/

setAverage(true); /*asks that a average row is added to any table generated onwards*/

setVariance(true); /*asks that a variance row is added to any table generated onwards*/

setStandardDeviation(true); /*asks that a standard deviation row is added to any table generated onwards*/

createCrossDiagram({"Q5_SQ_3"},{"Q5_SQ_5"}); /*creates a cross diagram (currently table) as an output*/

/*Line1*/

setChartType(Diagram_ChartType_Line); /*sets the chart type to be shown to be a line chart of any diagrams to be created onwards*/

setDirection(Diagram_DirectionType_Vertical); /*asks that the results of diagrams is shown vertical of any diagrams to be created onwards*/

removeFilter(a); /*makes sure that the earlier applied filter 'a' is no longer applied to any diagrams onwards*/

createFrequenceDiagram("Q5_SQ_3"); /*creates a frequency diagram (currently line) as an output*/

/*Bar1*/

setChartType(Diagram_ChartType_Bar); /*sets the chart type to be shown to be a bar chart of any diagrams to be created onwards*/

createFrequenceDiagram("Q5_SQ_3"); /*creates a frequency diagram (currently bar) as an output*/

/*Pie1*/

setChartType(Diagram_ChartType_Pie); /*sets the chart type to be shown to be a pie chart of any diagrams to be created onwards*/

createFrequenceDiagram("Q5_SQ_3"); /*creates a frequency diagram (currently pie) as an output*/

/*Radar1*/

setChartType(Diagram_ChartType_Radar); /*sets the chart type to be shown to be a radar chart of any diagrams to be created onwards*/

createFrequenceDiagram("Q5_SQ_3"); /*creates a frequency diagram (currently radar) as an output*/

/*Table2 - notice that this table will have removed many of the statistical rows of Table1*/

setChartType(Diagram_ChartType_Table); /*sets the chart type to be shown to be a table of any diagrams to be created onwards*/

setTotal(true); /*asks that there is no total column in the shown results on any diagrams to be created onwards*/

removeAllQuantiles(); /*asks that no quantile rows are added to any table onwards created*/

removeAllPercentiles(); /*asks that no percentile rows are added to any table generated onwards*/

setMedian(false); /*asks that no median row is added to any table generated onwards*/

setAverage(false); /*asks that no average row is added to any table generated onwards*/

setVariance(false); /*asks that no variance row is added to any table generated onwards*/

setStandardDeviation(false); /*asks that no standard deviation row is added to any table generated onwards*/

createFrequenceDiagram("Q5_SQ_4"); /*creates a frequency diagram table as an output*/