Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
pfb93
Contributor II
Contributor II

Issue with variable in expression

hi all,

ive got the following variable vActualYear = year(today()) and I want to use ist in the following expression:

Sum({<Year ={'$(vActualYear)'}>}Amount), but it is not working!

I also tried :

  • Sum({<Year =$(vActualYear)>}Amount)
  • Sum({<Year ={$(vActualYear)}>}Amount)
  • Sum({<Year ='$(vActualYear)'>}Amount)

and none of these worked. It is working properly when I use:

Sum({<Year ={'2018'}>}Amount)

 

Can someone ple help me? Thanks!

1 Solution

Accepted Solutions
vitaliichupryna
Creator III
Creator III

Hi, 

Both of this will work fine:

Sum({<Year ={$(=vActualYear)}>}Amount)

Sum({<Year ={$(vActualYear)}>}Amount)

You have a problem with variable, you should add '=' in your expression.

In this case you will calculate vActualYear on the application level

Thanks,

Vitalii

community example.jpg

View solution in original post

3 Replies
arulsettu
Master III
Master III

try like this

Sum({<Year ={'$(=vActualYear)'}>}Amount)

 

 

pfb93
Contributor II
Contributor II
Author

This is also not working 😕
vitaliichupryna
Creator III
Creator III

Hi, 

Both of this will work fine:

Sum({<Year ={$(=vActualYear)}>}Amount)

Sum({<Year ={$(vActualYear)}>}Amount)

You have a problem with variable, you should add '=' in your expression.

In this case you will calculate vActualYear on the application level

Thanks,

Vitalii

community example.jpg