Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to show data for the past 12 months of the current date (including current month)
Currently, my dimension for my chart is a calculated dimension:
=date(MonthName([rcptdate]), 'MM-YY')
How do I only show the past 12 months?
HI
Sum({<rcptdate={">=$(=timestamp(MonthStart(Today(),-12)))<=$(=timestamp(Today()))"}>}extcost)
Hope it helps
Hi
=sum({<Date = {'>=$(=vVar1)<=$(=vVar)'}>}Sales)
vVar1
=AddMonths(Date,-12)
vVar
=AddMonths(Date,0)
This can be done using set analysis
Example if ur date field is rcptdate and ur present expression is Sum(Sales)
Sum({<rcptdate={">=$(=MonthStart(today(),-12)))<=$(=Today())"}>} Sales)
If your requirement is based on the given date
Sum({<rcptdate={">=$(=MonthStart(vSelectedDate,-12)))<=$(=vSelectedDate)"}>} Sales)
vSelected date is a variable which has the date selected.
Celam:
Where exactly do I put this? If I put it in expression, it tells me "No data to display"
and my current expression was:
Sum(extcost)
Then, changing it using your tip:
Sum({<rcptdate={">=$(=MonthStart(today(),-12)))<=$(=Today())"}>} extcost)
And I get "no data can be displayed"
Any ideas?
Actually, I think I found the first issue:
I change the Today() to Now() and that seemed to get data to come back
It is, however, still giving me all data back, and not the past 12 months
Check the date format for both MonthStart(Today()) and your rcptdate field. Is it same?
Yes, they are the same
Try this
Sum({<rcptdate={">=$(=MonthStart(today(),-12))<=$(=Today())"}>} extcost)
There is a typo mistake in braces
That gives me "no data to display". If I change Today() to Now() I get data, but all time data, not past 12 months
It will work. can you send me a sample?