Hi Bhavin,
If you don't have any modelling limitation, then you can do it by changing the infoprovider design. You can add two key figures where you select the aggregation type as max and min acording to posting date. And in the query you can directly add a formula like Date1 - date2 to find no. of days.
When you add movement type to your query, it will work as you require.
Regards
Yasemin...