Dim arrRowQuestions1 = Survey.Questions.FilterByTag("Seasonal Rating").FilterByTag("Ad 2").FilterByTag("1st Brand").FilterByTag("Autumn/Winter").FilterByTag("Day") Dim arrRowQuestions2 = Survey.Questions.FilterByTag("Occasion Relevance").FilterByTag("Main Competitor").FilterByTag("Drinking at work") Dim arrRowQuestions3 = Survey.Questions.FilterByTag("Occasion Relevance").FilterByTag("Competitor").FilterByTag("Drinking at work") Dim arrColQuestions = Survey.Questions.FilterByTag("Demographics") Dim resPortfolio As Portfolio Dim resItem1 As PortfolioItem Dim resItem2 As PortfolioItem Dim ProfileColumn as Profile Dim ProfileRow1 as Profile Dim ProfileRow2 as Profile Dim i For i = 1 to arrRowQuestions1.Count ProfileRow1.add(arrRowQuestions1[i]) Next i Dim k For k = 1 to arrRowQuestions2.Count ProfileRow2.add(arrRowQuestions2[k]) Next k Dim h For h = 1 to arrRowQuestions3.Count ProfileRow2.add(arrRowQuestions3[h]) Next h Dim j For j = 1 to arrColQuestions.Count If arrColQuestions[j].Type <> "numeric" Then ' Select only 'Demographics' questions that are not numeric ProfileColumn.add(arrColQuestions[j]) ' Add them to the column profile Endif Next j ' Create Sub-poulation Dim mySP as SubPopulation mySp.Name = "SEG is ABC1" mySp.Description = "All respondents with higher socio-economic group" mySp.Script = "??D4?? Has {1;2;3}" mySp.Save() resItem1.SetType(1) ' resItem1.SetTitle("R1: Competitor occasion relevance - 'Drinking at work'") resItem1.TabDef.SetSubPopulation(mySP) ' Apply the sub-population created in this script to the tab definition resItem1.TabDef.ReadTabTemplate("Askia Simple") resItem1.TabDef.Rows.add(ProfileRow1) resItem1.TabDef.Columns.add(ProfileColumn) resPortfolio.Add(resItem1) resItem2.SetType(1) resItem2.SetTitle("E1: Autumn/Winter Day Seasonal Rating - 'Ad2 (1st Brand)'") resItem2.TabDef.SetSubPopulation(mySP) ' Apply the sub-population created in this script to the tab definition resItem2.TabDef.ReadTabTemplate("Askia Simple") resItem2.TabDef.Rows.add(ProfileRow2) resItem2.TabDef.Columns.add(ProfileColumn) resPortfolio.Add(resItem2) resPortfolio.Save(Survey.Directory + "7.1 Specify Developed Questions & New Sub-population (Tags).xml") resPortfolio.Open()