Qlik Community

Qlik Sense App Development

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

Announcements
Uploads getting stuck in the virus scanner. We are investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
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!

1 Solution

Accepted Solutions
Highlighted
Specialist II
Specialist II

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.

View solution in original post

2 Replies
Highlighted
Specialist II
Specialist II

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.

View solution in original post

Highlighted
Contributor III
Contributor III

It works perfectly now, Gabor!

Thank you.