4 Replies Latest reply: Dec 10, 2012 11:50 AM by Jaromír Frais

# Chart formula

Hi,

could you pls advice me a formula for a chart in actual month.

I have dimensions - year,month. Than i have 4 expressions(sales) and i need to create a pie chart for actual period. A pie chart will concist 4 expressions = 100%. There must be a formula,that should say - for all 4 expressions take only sales in actual month (something like MAX month)

Could you tell me how i could do it

Thx

Jerry

• ###### Re: Chart formula

You should be able to use set analysis expressions. To get the sum of Sales of the last month try:

sum({<Year={\$(=max(Year))},Month={"\$(=max({<Year={\$(=max(Year))}>}Month))"} >} Sales)

Months can be troublesome because they can have a textual and a numeric value. If you have such a Month field you may need this instead:

sum({<Year={\$(=max(Year))},Month={"=num(Month)=\$(=max({<Year={\$(=max(Year))}>}Month))"} >} Sales)

• ###### Re: Chart formula

Dear Gysbert,

thanks for you advice. Could you tell me,what in your formula (year,month) is a dimension field and what is a function.I have for my existing field for year and month a czech names in databasses (instead of year="Rok",instead of month="Měsíc" and now i cannot find out what´s function and what´s my existing field.I tried a few combination,but my chart doesn´t work and cannot display any data.

Thx a lot for your message:-)

J.

• ###### Re: Chart formula

Month, Year and Sales are the fields. So anything starting with a Capital is a field.

• ###### Re: Chart formula

Yeah,it works now correctly:-)

Thx a lot

J.