on 04-30-2018 2:57 PM
Hallo SAP support.
Please help me.
Every month when I refresh report I must manually change date from the beginning of the year to the end of the last month:
1.1.2018 - 31.1.2018
1.1.2018 - 28.2.2018
1.1.2018 - 31.3.2018
Now it will by: 1.5.2018
Question:
Exist date period from the beginning of the year to the end of the last month?:
now I need: 1.1.2018 - 30.4.2018 so I do not have to manually change?
"YearToDate" is probably not correct,
thanks for help
marek
I'm going to assume that you're not using parameters for this - there's no way to do this with parameters. However, there is a way to do it with a couple of formulas:
{@FirstOfYear}
if Month(CurrentDate) > 1 then Date(Year(CurrentDate), 1, 1) else Date(Year(CurrentDate) - 1, 1, 1)
{@LastMonthEnd)
if Month(CurrentDate) > 1 then Date(Year(CurrentDate), Month(CurrentDate), 1) - 1 else Date(Year(CurrentDate) - 1, 12, 31)
Then you'll need to modify the formula in the Select Expert by hand to include something like this for your dates:
{MyTable.DateField} >= {@FirstOfYear} and {MyTable.DateField} <= {@LastMonthEnd}
Note that these formulas are set up to roll from year to year as well as from month to month so you won't have to edit them for a new year as well as for a new month.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanx many thanx really Dell Stinnett-Christy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Christy, You helped me.
Yes, That's exactly what I am looking for. If you allow 1 question.
Somethimes I need this date period: {@Last12month} for example: 1.5.2017 - 30.4.2018
30.4.2018 = {@LastMonthEnd) ok I understand, but how define 1.5.2017 ?
if this refresh this month the period must be 1.5.2017 - 30.4.2018
if this refresh next month the period must be 1.6.2017 - 31.5.2018 etc...
THANKS for solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.