7 Replies Latest reply: Apr 15, 2014 8:08 AM by S S

# Problem with SUM

Hello.

Can you help me to write this expression "sum({\$<Scenario={'Control budget '&Year&' (by the quarter)'}>} Sales)", correctly?

The main term is when I select the Year (for example: 2014), it inserted in the expression and Scenario should get 'Control budget 2014 (by the quarter)' and  expression return total "Control budget 2014 (by the quarter)" sales, when I select "2013" it return total "Control budget 2013 (by the quarter)" sales.

• ###### Re: Problem with SUM

Try This

sum({\$<Scenario={'\$("Control budget" & GetFieldSelections(Year) & " (by the quarter))"}

• ###### Re: Re: Problem with SUM

Hi, Alessandro.

Can you see my attached sample, maybe I do something wrong?

Best regards, Stark

• ###### Re: Problem with SUM

Define a variable and use that in the expression, like:

Variable1='Control budget  '&GetFieldSelections(Year)&' (by the quarter)'

Expression:

sum({\$<Scenario={'\$(Variable1)'}>}Sales)

• ###### Re: Re: Problem with SUM

Thank you, Tresesco.

This is exactly what I need.

Best regards, Stark.

• ###### Re: Problem with SUM

Hai Frd Try This One

GetFieldSelections(Scenario)&chr(10)&sum(Sales)

Result Like That

• ###### Re: Problem with SUM

Hi

This will work as long as there is a single selected or possible value of Year:

=sum({\$<Scenario={"\$(='Control budget ' &Year & ' (by the quarter)')"}>} Sales)

HTH

Jonathan

• ###### Re: Re: Problem with SUM

Thank you, Jonathan.