Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Specialist
Specialist


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
Highlighted
Specialist
Specialist

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!

Highlighted
Partner
Partner

Did you try with:

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


Let us know 🙂


Simone

Highlighted
Not applicable

Thanks for your quick answer!

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

Thx!!

Highlighted
Not applicable

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

Thx

Highlighted
Specialist
Specialist


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

Highlighted
Not applicable

YES!!! Thank You!!!