Create Indirect Xpath

Hi everyone,
How can I create an indirect path name that can be evaluated.using a formula e.g.

Concat(‘${’, ‘grp’, ${tim1},‘}’)

${tim1} possible values: rugby, football, tennis etc

I already created the fields: grprugby, grpfootball, grptennis etc.

Trying to deploy this formula gives an Xpath error.

I’m trying to use it to build something similar to a “Case Statement” that is available in most programming languages.

Does anyone have a solution that says if the response to a choice question is " XX" , then extract data stored in field “grpXX” without using nested if’s, because the list of items under tim1 is much.

@Elvis-Great, maybe you could share a dummy question and a dummy choices with the community so that the community should understand your issue more pictorially. Please also try to explain your requirement in detail.