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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using a variable with field without any aggregation functions

Hi

Imagine if the field name is ABC which contains sales value. I want to calculate the sale of the CurrentYear and CurrentMonth. So I have created 2 variables, one to calculate the CurrentYear(vCurrentYear) and other to calculate the CurrentMonth(vCurrentMonth).

Currently in expression, I have put 'ABC' as it is the field name.

I want to do his I want to pass this variable in to the expression so that it gives the sales of the CurrentYear and CurrentMonth. Below variable works fine in if condition. How could I use that without any if condition or (Sum or Count).


{<[FINISHMONTH] = {'$(vCurrentMonth)'}, [FINISH_YEAR] = {'$(vCurrentYear)'}>}


What I mean to say is that

In expression it is: ABC

I want to pass the above variable with that so that it gives the sales of the CurrentYear and CurrentPeriod.

I did some like below in the expression. (I know it doesn't work like that. Just copied for your understanding what exactly I wants.)

Expression: {<[FINISHMONTH] = {'$(vCurrentMonth)'}, [FINISH_YEAR] = {'$(vCurrentYear)'}>}ABC

Hope that some one can help me out on this.

2 Replies
maneshkhottcpl
Partner - Creator III
Partner - Creator III

{<[FINISHMONTH] = {'$(#vCurrentMonth)'}, [FINISH_YEAR] = {'$(vCurrentYear)'}>}

Not applicable
Author

Please send me the complete code. You didn't pass ABC field with that.