cancel
Showing results for 
Search instead for 
Did you mean: 

calculation view - end date based on start date

0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi,

Refer to link below:

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

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

0 Kudos

Hi,

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

Former Member
0 Kudos

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 Kudos

Thank you. Works perfect 🙂

Answers (0)