You can use below statement considering, you need 1st ranked brands of attributes 4 & 7 and ranking question name is Q1 with only one column.
AIE(Q2_c1.4,1)
AIE(Q2_c1.7,1)
Based on the attribute number in parent list of your loop constructed list, you just need to change the number 4, 7 in the perl logic.