Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

rfreire06
New Contributor III

Using variable as modifier on chart data selection

Hi everyone,

I have a series of data that I would like to filter for the current year to be shown in my chart. For that, I have created a variable that returns the current year and tried to use it as a set modifier. However, it seems there is something wrong as the values displayed on my chart are all 0s. From my understanding, something is preventing it from recognizing the variable result as 2018.

When I assign the variable to a text box, it correctly shows 2018.

Here's how the expression looks like:

sum({<[MovNF Código MovCtb] = {100,109,110,112,123,131,132,133,134,140,142,143,149,152,156,162,168,169,181,186,139,145,197,199},

[NF Flag Status] = {'N'},Ano={vCurrentYear}>}

[MovNF Valor Contabil])

Btw, I am creating the variable through the variables overview, not from the data editor.

vCurrentYear = year(today())

Any help will be gratefully appreciated!

Tags (2)
1 Solution

Accepted Solutions
undergrinder
Valued Contributor II

Re: Using variable as modifier on chart data selection

Hi Rhenan,

try in this form:


sum({<[MovNF Código MovCtb] = {100,109,110,112,123,131,132,133,134,140,142,143,149,152,156,162,168,169,181,186,139,145,197,199},

[NF Flag Status] = {'N'},Ano={'$(=$(vCurrentYear))'}>}

[MovNF Valor Contabil])

G.

2 Replies
undergrinder
Valued Contributor II

Re: Using variable as modifier on chart data selection

Hi Rhenan,

try in this form:


sum({<[MovNF Código MovCtb] = {100,109,110,112,123,131,132,133,134,140,142,143,149,152,156,162,168,169,181,186,139,145,197,199},

[NF Flag Status] = {'N'},Ano={'$(=$(vCurrentYear))'}>}

[MovNF Valor Contabil])

G.

Highlighted
rfreire06
New Contributor III

Re: Using variable as modifier on chart data selection

It works perfectly now, Gabor!

Thank you.