2 Replies Latest reply: Nov 29, 2012 3:13 PM by Celambarasan Adhimulam

# Copying October's YTD value for November & December

Hi,

I have an expression which calculates the YTD value as follows:

num(sum({\$<YEAR={\$(vMaxYear)},MONTH_NO={'<=\$(vMaxMonth)'}, MONTH=>}ABC_Flag)/sum({\$<YEAR={\$(vMaxYear)},MONTH_NO={'<=\$(vMaxMonth)'}, MONTH=>}Total_Flag),'#,##0.0%')

MONTH is a list box in the document and the YTD changes based on the MONTH selected. MONTH='Sep' or any other month before Sep

This works perfectly fine. Here vMaxYear=2012, vMaxMonth=max(MONTH_NO) where MONTH_NO is 9 if 'Sep' is selected.

I want this expression to show September's value when I select Oct/Nov/Dec as MONTH. I mean my values are freezed till Sep, and this expression should only evaluate to YTD(Sep) value even if I select Oct/Nov/Dec from the list box. Please guide me how to do this. I can't really find a way. The Monthly value for the same expression for the month of October/November/December can be ignored.

Would appreciate all help at the earliest.

Thanks,

Tutan

• ###### Re: Copying October's YTD value for November & December

HI

May be try like this

vMaxMonth

value:

= if(wildmatch(Month,'oct','nov','dec'),9,max(Month_NO))

Hope it helps

• ###### Re: Copying October's YTD value for November & December

Change your vMaxMonth variable value as NumMin(Month(Today()),Max(Month_NO))

Or

To be specific of completed months NumMin(Month(If(Today()<MonthEnd(Today()),AddMonths(Today(),-1), Today())),Max(Month_NO))

Hope it helps