Further Askia Automation Script examples
Here are some more powerful examples of what can be accomplished with automation scripts. Please click on the images of the scripts to download the scripts.
- Col Sig Selection (%) Hole-count by Wave.
- Col Sig Selection (means) Hole-count by Wave.
- Response sort from Main Brand List question carried forward to subsequent questions.
- Keep top n rows selected for sorted tables.
Col Sig Selection (%) & (means) Hole-count by Wave
The idea is that we produce a streamlined hole-count. Often a full hole-count will be produced with col sig testing between the previous and current wave to identify significant shifts in data. This involves sifting through reams of insignificant data to pick out those key, significant changes we are looking for. What better than to automatically create a table that has only the significantly different row responses and questions shown!
1. Col Sig Selection (%)
- We create a filter for the previous and current waves (lines 7 to 19).
- We loop through all the survey questions (lines 22 to 57).
- We specify question types to select (lines 27 to 30, 33).
- We loop through the responses of each question (lines 35 to 52).
- Define the column bases and percentages filtered by previous and current waves (lines 38 to 41).
- Build the formula below for classical student test (lines 43 to 46).
- Test if significant and keep only those questions and their responses where significance found (lines 48 to 51).
- Add the required questions and their responses to the rows and columns (lines 54 to 56, 59, 60).
- Create the tab definition, add its settings, add it to the portfolio, then save and open it (lines 61 to 71).
2. Col Sig Selection (means)
- We create a filter for the previous and current waves (lines 7 to 19).
- We loop through all the survey questions (lines 22 to 82).
- We specify question types to select (lines 27 to 32, 36).
- We loop through the responses of each question (lines 38 to 42).
- Define column bases, means and standard deviations filtered by previous and current waves (lines 53 to 58, 60 to 65).
- Build the formula below for classical student test (lines 68 to 73).
- Test if significant and keep only those questions where significance found (lines 75 to 77).
- Add the required questions and their responses to the rows and columns (lines 79 to 81, 84, 85).
- Create the tab definition, add its settings, add it to the portfolio, then save and open it (lines 86 to 96).
Sorted tables: apply sort order to subsequent tables/keep top n rows for each sorted table
The idea is that we can now write automation scripts to fill in the gaps where there are some small missing functionalities in AskiaAnalyse’s in-built settings.
3. Apply sort order to subsequent tables
- We specify our row questions by filtering the survey questions with the ‘BrandList’ tag (line 5).
- We specify our main question for sorting – the sorting from this question will be applied to all subsequent brand list questions. The preference would be to have this one question tagged as something like ‘Main Sort Question’ so the script can remain fully generic (line 6).
- We push the counts from the main sort question into an array and then work out the indexes from max to min to store its sort order (lines 9 to 16).
- We loop through survey questions (lines 23 to 29).
- We isolate the tagged questions and those which are not ‘Coding’ (grouped responses/values) questions and add them to our row profile with the required sort order established previously (lines 26 to 28).
- For our column profile we will add current & previous wave as used in previous examples (lines19, 20, 31, 32).
- Create the tab definition, add its settings, add it to the portfolio, then save and open it (lines 34 to 45).
4. Keep top n rows for each sorted table
- We specify our row questions by filtering the survey questions with the ‘BrandList’ tag (line 5).
- We loop through survey questions (lines 23 to 29).
- We loop through the responses of each question to create an array of counts. Then we work out the indexes from max to min to store each question’s sort order (lines 21 to 26). Line 21 of the code shown above is where we specify the number of responses to keep and show for each variable. Here it’s the top 5.
- We isolate the tagged questions and those which are not ‘Coding’ (grouped responses/values) questions and add them to our row profile with the required orders and selections per question established above (lines 24 to 26).
- For our column profile we will add current & previous wave as used in previous examples (lines 19, 20, 29, 30).
- Create the tab definition, add its settings, add it to the portfolio, then save and open it (lines 32 to 42).