Skip to Content
0

calculation view - end date based on start date

Jan 03 at 02:33 PM

80

avatar image
Former Member

Hi,

we use graphical calculation views for our data model. how can you get the end date if you only have startdate.

example:

Product_1 | 3000 | 01.01.2018
Product_1 | 3000 | 01.05.2018
Product_1 | 1000 | 01.07.2018

Product_2 | 1000 | 01.02.2018

Expecting result:

Product_1 | 3000 | 01.01.2018 | 01.05.2018
Product_1 | 1000 | 01.07.2018 | 31.12.9999
Product_2 | 1000 | 01.02.2018 | 31.12.9999

Thank you

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Jan 04 at 08:31 AM
1

Hi,

Refer to link below:

https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.02/en-US/e7ef7cc478f14a408e1af27fc1a78624.html

Lead/lag functions give you preceding or subsequent records when ordered by required fields. In your case, you can easily get "next" from date using this function. Subtract 1 from this value to get "to date".

Hope that helps.

Thanks,

Anup

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi,

Thank you. But we are using graphical calculation views. Is this even possible to use in a graphical calc view?

0
Former Member
Former Member

Yes, you can create a table function and write SQL script there.

Table functions can be used in graphical calculation views just like ordinary tables.

0
Former Member

Thank you. Works perfect :)

0