Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable as field name in set analysis

Dear all,

I have the following Issue:

I created a variable "vYear" and this variable contains a flag from the master calendar. (e.g. vYear = "CY" (which represents the current Year)).

I used to have the following Expression which worked fine for me and calculates the total sales of the current year:

Sum({1<CY = {1} >} Sales.Amount)

Now I want to replace the "CY" with the Variable "vYear". As far as I know only field names are allowed on the left Hand side of the modifier. I tried the following:

Sum({1<$(vYear) = {1} >} Sales.Amount)

Unfortunately, QV does not recognoze my variable as the CY field flag from the master calendar.

Is it anyway possible to use variables on the left Hand side of the modifier, if the result of the variable is a field Name?

Please help me with this, I hope this will work!

Thanks in advance!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author


In the attched qvw you can find two text objects that get same result, one with field CY, the other with varianle vYear.

Please, see the Variable setting in order to see that there is not = in the definition of vYear

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi

I tried with a simple test and I understand that you should define your variable without equal sign in the expression.

Try in this way, let me know!

simospa
Partner - Specialist
Partner - Specialist

Did you try with:

Sum({1<$(=vYear) = {1} >} Sales.Amount)   ?


Let us know 🙂


Simone

Not applicable
Author

Thanks for your quick answer!

Can you please write the Formular becuase I do not understand which equal sign you want to delete..

Thx!!

Not applicable
Author

Yes, i tried... unfortunately with the same result..

Thx

Anonymous
Not applicable
Author


In the attched qvw you can find two text objects that get same result, one with field CY, the other with varianle vYear.

Please, see the Variable setting in order to see that there is not = in the definition of vYear

Not applicable
Author

YES!!! Thank You!!!