Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
yanivvl0
Creator III
Creator III

How to use a variable in chart expresion ?

hello to all the QV Climbing  ,

i have an expression : sum (  aggr (  max  (  {$<Subject={1}>}  if (  type38=1 or type39=1 ,  amount , 0  )      )  , proj_code  )  )

and i want to make it dynamic by usin a variable :  vIfAmount = if (  type38=1 or type39=1 ,  amount , 0  )   

in:

sum (  aggr (  max  (  {$<Subject={1}>}  $(vIfAmount)      )  , proj_code  )  )


but i get 0  :

v_exp0.PNG


is there any way to make the calculation work ?

thanks .

1 Solution

Accepted Solutions
sunny_talwar

Not sure what your exact requirement is, but try the attached

Capture.PNG

View solution in original post

5 Replies
sunny_talwar

Not sure what your exact requirement is, but try the attached

Capture.PNG

yanivvl0
Creator III
Creator III
Author

thanks

jonathandienst
Partner - Champion III
Partner - Champion III

The variable had no value in it,. If you assign the variable to your expression, it works correctly.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sunny_talwar

No problem at all

yanivvl0
Creator III
Creator III
Author

yea , i wrote with = , and then i delete ..