Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I am having a scenario,that have to calulate YTD&MTD values in pivot table.
Ytd is nothing but cummltive values.And MTD values values belongs to current month.Iam having data
from Ape 2009 to Sep 2009.Thing is when I clik Jul 2009,in YTD I have to attain cummltive values of APr 2009,May 2009,Jun 2009 and Jul 2009.That means,
YTD of Jul 2009->(Apr 2009+May 2009+Jun 2009+Jul 2009)
So if any one of you come across this kind of issue please help me out.It is very urgent.
Thanks&Regards
Jai
Hi,
You can sole this by using set analysis. see an example for YTD below (this is an example of how the expression could look like)
vTodayDate is a variable you can set in the script using a let statement
Sum({<[Accounting period] = {'$(=monthstart(vTodaysDate))>} RowAmount)
Hi Again,
to clarify my example was for MTD and the expression should be
Sum({<[Accounting period] = {'$(=monthstart(vTodaysDate))'}>} RowAmount)
See also below for a simple example for YTD is below
Sum({<[Accounting year] = {$(=vCurrentYear)}>} RowAmount)
sum(if((Week*1)<=(vCurrentWeek*1),rowamount))
sum(if((Month*1)<=(vCurrentMonth*1),rowamount))
Sums if month is less than or equal too current month. Same thing for week.