Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
zagzebski
Creator
Creator

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

Labels (1)
1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

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

sum([$(vMeasure)])

View solution in original post

5 Replies
stigchel
Partner - Master
Partner - Master

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

sum([$(vMeasure)])

sunny_talwar
MVP
MVP

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
Creator
Creator
Author

Thanks - Can't believe it was that simple!

zagzebski
Creator
Creator
Author

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

sunny_talwar
MVP
MVP

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