Creating a Banner

A banner traditionally refers to different demographic data that is combined and presented in the columns of a table.  A simple banner may contain Age and Gender categories, side by side.  A more complex banner may nest categories, so that Gender is repeated for each Age category.

Below are examples of how to create the two types of banners, using DataCracker's built-in Demo Data:

Simple Banner: Age and Gender


Create a new variable for each age and gender category

1. INSERT > Variables > Numeric
2. Enter the following into the box JAVASCRIPT CODE under PROPERTIES:
    Age == 2
3. Enter the name (e.g. "18 to 24") under PROPERTIES > Name, and a short variable reference name under PROPERTIES > Reference name.
4. Repeat steps 1-3, replacing the JavaScript formula and name for the following:
JavaScriptName
Age == 325 to 29
Age == 430 to 34
Age == 535 to 39
Age == 640 to 44
Age == 745 to 49
Age == 850 to 54
Age == 955 to 64
Age == 1065 or more
gender == 1Male
gender == 2Female

Combine the new variables into one

1. DATA MANIPULATION > Variables > Combine
2. Check all of the new variables.
3. Click Combine
    You now see each age and gender category as the row of a table.
4. You can re-order the rows by dragging and dropping, or by using DATA MANIPULATION > Rows/Columns > Sort > Sort Labels - Ascending
5. Click HOME > Data Selection > Show > Rename
6. Call the new data Banner and click Rename.

Change the data to percentages

1. DATA MANIPULATION > Structure > Percentages
2. In the Values to Count box, ensure that 1 is checked.
3. Click OK.

View the new banner

1. Select the page called Weight-consciousness.
2. Click the HOME > Data Selection > By dropdown.
3. In the list that appears, select Banner.
4. You should now see the banner in the columns of the table.
5. In this example, the banner makes the table quite wide, so to make it fit on the page, we shrink the font size to 8 using APPEARANCE > Font.



Complex Banner: Gender nested under Age

The process for complex banners is the same as for simple banners, except that the JavaScript and names are different.  Use the following JavaScript and names in the Demo Data to achieve a nested banner.

JavaScriptName
Age == 2 && gender == 118 to 24, Male
Age == 2 && gender == 218 to 24, Female
Age == 3 && gender == 125 to 29, Male
Age == 3 && gender == 225 to 29, Female
Age == 4 && gender == 130 to 34, Male
Age == 4 && gender == 230 to 34, Female
Age == 5 && gender == 135 to 39, Male
Age == 5 && gender == 235 to 39, Female
Age == 6 && gender == 140 to 44, Male
Age == 6 && gender == 240 to 44, Female
Age == 7 && gender == 145 to 49, Male
Age == 7 && gender == 245 to 49, Female
Age == 8 && gender == 150 to 54, Male
Age == 8 && gender == 250 to 54, Female
Age == 9 && gender == 155 to 64, Male
Age == 9 && gender == 255 to 64, Female
Age == 10 && gender == 165 or more, Male
Age == 10 && gender == 265 or more, Female


However, be warned, this will make a very wide table!  For both readability and presentation purposes, it makes more sense to combine the Age categories into subcategories, as in the below banner.

JavaScriptName
(Age == 2 || Age == 3 || Age == 4 || Age == 5) && gender == 1Under 40, Male
(Age == 2 || Age == 3 || Age == 4 || Age == 5) && gender == 2Under 40, Female
(Age == 6 || Age == 7 || Age == 8 || Age == 9 || Age == 10) && gender == 140 and over, Male
(Age == 6 || Age == 7 || Age == 8 || Age == 9 || Age == 10) && gender == 240 and over, Female




Feedback and Knowledge Base