Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Evaluating Variable within another Variable

I have a chart where the user selects the dimension from an input box. For dimensions that are more than one word, the dynamic chart doesn't work because I need brackets around the name:

Example:

If the user selects Target Line, I need to pass [Target Line].

I created a new variable using the code:

='[' & $(pivotDim1) & ']'

But this only returns [] without the selected dimension between brackets. My pivotDim1 variable works fine for reading the selected name, so this variable is not the problem. Any suggestions?

1 Solution

Accepted Solutions
MVP
MVP

Re: Evaluating Variable within another Variable

Try

='[' & pivotDim1 & ']'



edit:

or

='[' & '$(pivotDim1)' & ']'


4 Replies
MVP
MVP

Re: Evaluating Variable within another Variable

Try

='[' & pivotDim1 & ']'



edit:

or

='[' & '$(pivotDim1)' & ']'


borisman
Contributor III

Re: Evaluating Variable within another Variable

Hi Andy,

try this instead for your calculated dimension:

= $(='['&only(pivotDim1)&']')

Let me know how it goes and if you need me to explain how it works

Boris

Not applicable

Re: Evaluating Variable within another Variable

The expression without the dollar sign worked!

Not applicable

Re: Evaluating Variable within another Variable

It didn't work, but I was able to fix it by removing the dollar sign.