I am trying to loop through a set of variables to set up a group for each permutation of up to a certain number of variables (2 in this example). I would also like to set it up so that I do not create groups for the same variables in different orders. The code that I have so far is this:
Code: Select all
for !i=1 to indicators.@count
for !g=1 to indicators.@count
%reg1=indicators.@seriesname(!i)
%reg2=indicators.@seriesname(!g)
%regs=%reg1 + " " + %reg2
%regs=@wunique(%regs)
%regs=@wsort(%regs)
%name1="!i"
%name2="!g"
%rname=%name1 + " " + %name2
%rname=@wunique(%rname)
%rname=@wsort(%rname)
%regname="z_" + @replace(%rname," ","")
group {%regname} {%regs}
next
next