Hi, Andrea,
What is the code for the "subquestionvalue"?
This is not a serious question, is it?
Remember, what you entered in the subquestion relevance of the second question.
Something like "s1000_SQ001>2".
Meaning: The value of the subquestion "SQ001" of question "s1000" is greater then 2.
Here you have your subquestion value.
I thought about the validation a bit more.
Except the validations "sum=

", "count==6", "all unique" you have to check if the question is displayed. So you have to add sommething like the above "s1000_SQ001>2".
long.
So I think about a different design.
Instead of using an array(numbers)" with all the validation, use a ranking question where everything is built-in.
Have a look.