Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
undergrinder
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
undergrinder
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.

Anonymous
Not applicable
Author

It works perfectly now, Gabor!

Thank you.