cancel
Showing results for 
Search instead for 
Did you mean: 

This Week vs Last Week

Former Member
0 Kudos

Hello

I have SalesData coming from VBAK. I have SalesDocument Date which I joined with M_TIME_DIMENSION - DATE_SAP.

I can get the CALWEEK, CALMONTH, YEAR now. But below are my questions.

1. How to get "Lastweek" from any Date?

2.Create a report with Last Week Sales.

3. Compare This Year Last week with Last Year Last week.

The report should dynamically run. ( a User Prompt or a Input Variable would also be helpful)

I looked into below links but not sure it answers my questions.

https://help.sap.com/saphelp_hanaplatform/helpdata/en/20/e23edc7519101482eae3271722de36/content.htm?...

Accepted Solutions (1)

Accepted Solutions (1)

former_member182302
Active Contributor
0 Kudos

You have all the answers in your links, Have you gone through them? Found any specific issue while implementing?

Regards,

Krishna Tangudu

Answers (1)

Answers (1)

rindia
Active Contributor
0 Kudos

Hi Sarada,

If you know the start date of the the date-field then you can get

last week: ADD_DAYS(date-field, -7)

last year: ADD_YEARS(date-field, -1)

Regards

Raj

Former Member
0 Kudos

Thanks Krishna and Raj for replying.

I have to calculate WTD, MTD and so on...

I see the Scalar Procedures for MTD, but for YTD, WTD, QTD I dont have. Can you please share any details on the code.

and if I want to create a Calc Column - WTD,what formula( expression) I should use. I have CALWEEK( from M_TIME_DIMENSION) and Date from VBAK