Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I using this expression in test box for showing value in USD but actually i need to show rolling 6 months data based on current month dynamically..
i have year,month fields..
=num(Sum(ValueUSD)/1000000, '$#,##0.00')
****The rolling 6 months means for example we are currently in Apr i need to show the data for (Mar-14,Feb-14,Jan-14,Dec-13,Nov-13,Oct-13)****
Please help me in solving the problem..
Thanks,
Rahul
Current Month is April and hence your output should be
Oct-13
Nov-13
Dec-13
Jan-14
Feb-14
Mar-14
But as per Anand's reply, you will get for 5 months....
Please check and let me know if I am wrong...
I think my answer is correct !
If you have date field in your database, use below...
=num(Sum({<[YourDateField] = {'<=$(=MonthEnd(AddMonths(Today(),-1)))>=$(=MonthStart(AddMonths(Today(),-6)))'}>}ValueUSD)/1000000, '$#,##0.00')
Update : above solution tested and working fine in my application.
If it is not working, let me know the Format of YourDateField.
I am able to do in chart but how to do it text box..
Write like this in text box
MonthYear = YourMonthyearField
=num(Sum( {$<MonthYear = {">$(=num(AddMonths(MonthYear,-6))) <=$(=Num(MonthYear))"}>} ValueUSD)/1000000, '$#,##0.00')
Try my solution in text box
Update
Write like below in text box
In MonthYear = YourMonthYearField and if not avilable month year then write in load script like
MonthName(YourDatefield) as MonthYear,
=Num(Sum( {$<MonthYear = {">$(=Num(AddMonths(MonthYear,-6))) <=$(=Num(MonthYear))"}>} ValueUSD)/1000000,
'$#,##0.00')
I have month and year two different fields like Apr , FY14 some thing like this....and i dont have date filed..
You can write this in Text box also
=Num(Sum( {$<MonthYear = {">$(=Num(AddMonths(MonthYear,-6))) <=$(=Num(MonthYear))"}>} ValueUSD)/1000000,
'$#,##0.00')
Or
=Num(Sum( {$<MonthYear = {'>$(=Num(AddMonths(MonthYear,-6))) <=$(=Num(MonthYear))'}>} ValueUSD)/1000000,
'$#,##0.00')
With the help of Month and Year field in load script make the month year field like
Try like this
Month&' '& Date('20'&Right(FinancialYearFieldHere,2),'YYYY') as MonthYear
May be provide sample.