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

Construct an expression

Hi,

I have two buttons:

btnA - set expression to period jan-2016 to mar-2016

btnB - set expression to period apr-2015 to jun-2015

Then I have a variable vExpr:


- When btnA, vExpr gets the value 'MonthYear ={">=$(=Date(AddMonths(Min(MonthYear),-$(vMonthDiff)), 'MMM-YYYY'))<=$(=Date(AddMonths(Max(MonthYear),-$(vMonthDiff)), 'MMM-YYYY'))"}'

- When btnB, vExpr gets the value 'MonthYear ={">=$(=Date(min(addmonths(MonthYear,-12)),'MMM-YYYY'))<=$(=Date(max(addmonths(MonthYear,-12)),'MMM-YYYY'))"}'

Then I have an expression, in a text object with the following:

='=Money(SUM ({<' & $(vExpr) & ', AC_METRICA = {"Vendas Sem Iva"}>}[AC_VALOR_REAL]),vFormatNumber)'

I'm getting the next result in the text object:

=Money(SUM ({<MonthYear ={">=jan-2016<=mar-2016"}, AC_METRICA = {"Vendas Sem Iva"}>}[AC_VALOR_REAL]),vFormatNumber)

example21112016.png

When what I really want is the value of the expression above, that should be "90 013 728 €", just for an example.

I think my problem is in the equal signs but I'm not getting there.

Can you please help ?

Thanks in advance,

Sílvia

1 Solution

Accepted Solutions
sunny_talwar

May be add a dollar sign expansion

$(='=Money(SUM ({<' & $(vExpr) & ', AC_METRICA = {"Vendas Sem Iva"}>}[AC_VALOR_REAL]),vFormatNumber)')

View solution in original post

4 Replies
sunny_talwar

May be add a dollar sign expansion

$(='=Money(SUM ({<' & $(vExpr) & ', AC_METRICA = {"Vendas Sem Iva"}>}[AC_VALOR_REAL]),vFormatNumber)')

adamdavi3s
Master
Master

Hi Silvia,

I always hit these sorts of problems and it always takes some fiddling to sort out

Does

='Money(SUM ({<' & $(vExpr) & ', AC_METRICA = {"Vendas Sem Iva"}>}[AC_VALOR_REAL]),vFormatNumber)'

Not work for you? If not then try

$(='Money(SUM ({<' & $(vExpr) & ', AC_METRICA = {"Vendas Sem Iva"}>}[AC_VALOR_REAL]),vFormatNumber)')

Anonymous
Not applicable
Author

Hi Sunny,

Thanks for your help, it worked

I used this:

= $(='=Money(SUM ({<' & $(vExpr) & ', AC_METRICA = {"Vendas Sem Iva"}>}[AC_VALOR_REAL]),vFormatNumber)')

Anonymous
Not applicable
Author

Hi Adam,

Your answer works as well, as long as I put another "=", like in the reply I gave to Sunny.

Thanks too