Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
Experts,
I’m having
a problem with variable.
I have lots of variable like Var10, Var20, Var30, ect… and I want to use these variable in a dynamic way:
10, 20, 30, and so on is a filed value (fieldx) and I’d like to use the field value define variable name and to find variable value.
If field value is 10, I want to use $(Var10),
If field value is 20, I want to use $(Var20),
Is it possible?
I’ve tried with $(=’Var’&fieldx), but ’Var’&fieldx is correct, while $(=’Var’&fieldx) doesn’t work.
Can anyone help me?
Thank you
Have you tried creating a new variable that is 'Var'&fieldx and then referencing that variable instead? That way you would be referencing $(newVariable) instead of $(=’Var’&fieldx). I haven't tried it, but it's just a suggestion off the top of my head.
You need to use same temporary variables to do this.
See the attached file. Hope this helps you.
Regards
Hello cristina,
It will work this way:
=$(=('Var'&fieldx))
Thanks,
itsangad
Hello Christina,
What you have tried is correct..$(=’Var’&fieldx)
will you please try using = prior to this.
Like =$(=’Var’&fieldx)
Thanks
Advait
Thank you all!
Unfortunately, these are not ok.
what do you think about using if statement?
if (fieldx = '10', &(Var10),
if(fieldx = '20', &(Var20), ......))))
do you think this will slow the document?
Many Thanks
cristina
Hello Cristina,
Do you need dynamic values at the script level or chart level.
Though =$(=('Var'&fieldx)) works fine at chart level.
Yes you can use the if statement as well. As per my understanding, it should not effect much.
thanks,
itsangad
Hello,
I need it at chart level.
I try with if statement.
Thank you.
cristina
Hi,
Try this, if your field values are exactly multiples of 10 (i.e., 10, 20, 30.......)
=Pick(FieldValue/10, $(Var10), $(Var20), $(Var30))
Hope this helps you.
Regards,
Jagan.
Hello,
Can you upload your qvw.
thanks,
itsangad