Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How do I make my chart only show data up until todays date for previouse years?
I have tried doing it as an Expresstion like this:
Count ({<YEAR={$(vPreviousYear-1)},MONTH={'<=$(vMonth)'},DATE={'<=$(vToday)'}>}DATA)
But the result it the date is set as max in very month. So today it will only show up until todays date in all the present month also.
But I what the full data shown in the past months, and only month-to-date i present month.
Hi
I understand that for explample if today is 11/07/2017 you want to show data from 01/01/2016 to 11/07/2016.
Then, change DATE for DAY (if you have this field).
Regards
Will you provide variables which you used??
Hi,
For current year, from 1er of month to today :
=Count({<Year, Month,Date={">=$(=MonthStart(today())) <=$(=today())"}>} Data)
For previous year, from 1er of month to today :
=Count({<Year,Month,Date={">=$(=MonthStart(today(),-12)) <=$(=AddYears(today(),-1))"}>} Data)
Hope it helps.
Hi Jose,
Thanks for your reply.
When I try your solution, I'll get a blank chart.
Here are what I tried:
Count ({<YEAR={$(vPreviousYear)},MONTH={'<=$(vMonth)'},DAY={'<=$(vToday)'}>}DATA)
Hi Anil,
Here are the variables I used:
vPreviousYear) =year(today())-1
vMonth =month(today())
vToday =date(Today())
vTodayPreviousYear) =date(monthstart(today())-365,'DD-MM-YYYY')
Jean-Baptiste RENAULT skrev:
Hi,
or previous year, from 1er of month to today :
=Count({<Year,Month,Date={">=$(=MonthStart(today(),-12)) <=$(=AddYears(today(),-1))"}>} Data)
Hope it helps.
Hi Jean-Baptiste,
When I try this, I get a blank result. Why could that be?
What's the value of $(vToday)? Is needed a day not a date, because you are comparing days. Maybe the error is there.
If is a date, you can replace it with $(=day(today()))
Regards
The value of vToday =date(Today())
Then I try your solution with $(=day(today())), I getting data in the chart, but as I can see, I'm geting the result of the day, and not as I need: the date. I need to get the full month of the previouse month, and in the present month, I only want the data from the 1th of the month until today (ex 12th july).
Did I make my self more clear now?
Have you tried with the formula for current year? Does it works for you?
=Count({<Year, Month,Date={">=$(=MonthStart(today())) <=$(=today())"}>} Data)
You can try with :
=Count({<Year,Month,Date={">=$(=MonthStart(date(today()),-12)) <=$(=AddYears(date(today()),-1))"}>} Data)