Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

zagzebski
Contributor

Variable with spaces (in expression)

I have a variable that has the value of a measure depending on the selection of the user. It works but when I use it in my expression (sum) it always gives a value of 0.

The variable vMeasure result is Amount Revenue or Amount Premium.

I use it simply in the expression:  sum('$(vMeasure)')

I assume it has something to do with the fact that the translation would be : sum (Amount Revenue) with no brackets rendering it wrong?

Thanks in advance for any assistance!

Steve

Tags (1)
1 Solution

Accepted Solutions
stigchel
Honored Contributor

Re: Variable with spaces (in expression)

If it is the value of a field you are trying to display, try

sum([$(vMeasure)])

5 Replies
stigchel
Honored Contributor

Re: Variable with spaces (in expression)

If it is the value of a field you are trying to display, try

sum([$(vMeasure)])

Re: Variable with spaces (in expression)

Why not try your variable to be like this:

vMeasure = '[' & Measure & ']'

and then use it in your expression as Sum($(vMeasure))

I think this should work.

HTH

Best,

Sunny

zagzebski
Contributor

Re: Variable with spaces (in expression)

Thanks - Can't believe it was that simple!

zagzebski
Contributor

Re: Variable with spaces (in expression)

Thanks Sunny - tried that same thing and it didn't like it. The answer was as simple as adding the brackets [] around the measure.

steve

Re: Variable with spaces (in expression)

Hahahaha, it did not like it? QlikView can sometime do that to us... But I am glad you got the solution to what you were looking for.

Best,

Sunny

Community Browser