@Tom_R ,
You can use branch logic and embedded data as follows
!

!

!
Hello
@Tom_R,
I hope you are using Pick, group, Rank question
Step 1: Add two embedded data (eg: Group1Count, Group2Count ) in the survey flow before the Pick, group, Rank question
Step 2: Add the following js in the `js(OnUnload)` of the pick group rank question
var group1count=jQuery("#" +this.questionId+"group0 li").length;
var group2count=jQuery("#" +this.questionId+"group1 li").length;
Qualtrics.SurveyEngine.setEmbeddedData( 'Group1Count', group1count );
Qualtrics.SurveyEngine.setEmbeddedData( 'Group2Count', group2count );
Step3: Use the embedded data (eg: Group1Count, Group2Count ) wherever required in the survey
>
@Shashi said:
> Hello
@Tom_R,
>
> I hope you are using Pick, group, Rank question
>
> Step 1: Add two embedded data (eg: Group1Count, Group2Count ) in the survey flow before the Pick, group, Rank question
> Step 2: Add the following js in the `js(OnUnload)` of the pick group rank question
>
> var group1count=jQuery("#" +this.questionId+"group0 li").length;
> var group2count=jQuery("#" +this.questionId+"group1 li").length;
>
> Qualtrics.SurveyEngine.setEmbeddedData( 'Group1Count', group1count );
> Qualtrics.SurveyEngine.setEmbeddedData( 'Group2Count', group2count );
>
> Step3: Use the embedded data (eg: Group1Count, Group2Count ) wherever required in the survey
>
>
>
Note: You can scale this solution i.e if you have more than two groups then you can create that many embedded data, and add variables in the js and change the code as: if you want group 3 count then change js as follows `var group3count=jQuery("#" +this.questionId+"group2 li").length;` , as group count starts with 0, hence -1.