cancel
Showing results for 
Search instead for 
Did you mean: 

CR2013 - Use dynamic fieldname in formula

Former Member
0 Kudos

Hi experts,

I would like to know if it's possible to use a dynamic fieldname in a formula.

Example :

I have a query with many fields :

- ID

- Flag (can be 1, 2 or 3)

- Amount1

- Amount2

- Amount3

...

- Amount100

If Flag = 1, I need to take Amount1, If 2, Amount 2, ...

So I use a case statment :

select {Flag}

     case "1":

          {Amount1}

     case "2":

          {Amount2}

     case "3":

          {Amount3}

...

     case "100":

          {Amount100}

     default:

          0

Instead, what I would like to do is something like :

{Amount & {Flag}} to remove the case statement.

I'm not sure to be clear.

Thank you in advance.

Regards,

Thomas.

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Thomas,

If you want the field to be dynamic based on the flag, you would need that case statement.

-Abhilash

Former Member
0 Kudos

As I was unfortunately guessing, it's impossible to code a fieldname ?