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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Variable not displaying the value

Hello,

I created a variable called vTotal which is a formula and it contains one of the expressions I pulled out of the chart.  I just

wanted to save this value and use this variable when I need it.  So this is what I did but I can't get the value to display in a text object.

1. Settings -> Variable Overview -> Add

    I named it "vTotal" and pasted the expression into the Definition box.

2. Placed a text object and set the Text to "=$(vTotal)".

3. Saved the QVW file

4. Reloaded it.

The text object shows "--".  Looks like two dashes and I'm not able to see the result of the expression.

Am I doing this correctly or am I missing something?

Thanks

19 Replies
sunny_talwar

Try some variations:

=$(=vTotal) or

=$(vTotal)

you can also play around with expression stored within vTotal. Try it with and without '=' sign. =Expression vs. Expression.

Anonymous
Not applicable
Author

The formula uses AGGR(SUM()) just as an additional info.

Anonymous
Not applicable
Author

I tried:

=$(=vTotal) or

=$(vTotal)


Nothing is showing.


Here is the actual expression set to the variable vTotal:

AGGR(SUM({1 <%Col1 = {"$(=Col2)"}, %Col3 = {"$(=Col4"} >}[Amount1]) ,%Col1,%KEY_FY)

+

AGGR(SUM({1 <%Col1 = {"$(=Col2)"}, %Col3 = {"$(=Col4)"} >}[Amount2]) ,%Col1,%KEY_FY)

Clever_Anjos
Employee
Employee

Try

"=$(=vTotal)"


If does not work, please post your expression

Anonymous
Not applicable
Author

I just tried it.  The text shows "=$(=vTotal)".

See my expression in an earlier reply.

Digvijay_Singh

I think one bracket is missing as shown in red below -

AGGR(SUM({1 <%Col1 = {"$(=Col2)"}, %Col3 = {"$(=Col4)"} >}[Amount1]) ,%Col1,%KEY_FY)

+

AGGR(SUM({1 <%Col1 = {"$(=Col2)"}, %Col3 = {"$(=Col4)"} >}[Amount2]) ,%Col1,%KEY_FY)

Clever_Anjos
Employee
Employee

Set vTotal as  (please note the "="

= AGGR(SUM({1 <%Col1 = {"$(=Col2)"}, %Col3 = {"$(=Col4"} >}[Amount1]) ,%Col1,%KEY_FY)

+

AGGR(SUM({1 <%Col1 = {"$(=Col2)"}, %Col3 = {"$(=Col4)"} >}[Amount2]) ,%Col1,%KEY_FY)

Use $(vTotal)

Anonymous
Not applicable
Author

No, I didn't miss the bracket.  It is correct in QVW file.   It was just missing in this post.  Thanks for catching it.

Anonymous
Not applicable
Author

I actually did test it with prefixing with the "=" sign in the definition box where I add this variable.  But I just did it again

and in my text box's text property, I have it as $(vTotal).  I saved it, reloaded the qvw file.  The text box now shows

$(vTotal).   What's going on here???