Skip to main content

Acquired Amount within overlapping dates

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
JMAROUF
Creator II
Creator II

Acquired Amount within overlapping dates

Last Update:

May 22, 2021 6:52:51 PM

Updated By:

JMAROUF

Created date:

May 22, 2021 6:24:13 PM

Attachments

Insurance is one of the most complicated sectors in data analytics,   developers  struggle when it's required to calculated the acquired amount within the year, and especially those which overlap,  here is an example to solve such kind of  issues with Load Script:

JMAROUF_0-1621719248729.png

 

The picture below shows some subscribed  amount in different periods, but the customer needs the acquired amount within the year, if we take policy N°  004 as an example, we notice that we have a 7000,00 $ for a period of three years (2021 --> 2023), but how to proceed if the customer has to analyse year by year ? in my opinion it's usefull  to create as  many lines as we have in the covered period (EndYear-StartYear),  i have used some dummy data to demonstrate the solution discussed above:

JMAROUF_1-1621719378124.png

then i try to load the whole row as one field in order to load variables separately:

JMAROUF_3-1621720068400.png

it's time to call our generator, for each row we should create as many line as we have in the whole covered period:

JMAROUF_4-1621720253559.png

JMAROUF_7-1621721243907.png

JMAROUF_8-1621721287684.png

 

 

finally here's the generator of the result table:

JMAROUF_5-1621721133778.pngJMAROUF_6-1621721194332.png

 

 

here is the output:

JMAROUF_9-1621721374744.png

 

expressions used:

DiffDays:                       Round((EffectiveEndDate-EffectiveStartDate)+1)

DaysOfYear:                Round(YearEnd(EffectiveEndDate)-YearStart(EffectiveStartDate))

CoveredPeriod %:   Round((EffectiveEndDate-EffectiveStartDate)+1)/Round(YearEnd(EffectiveEndDate)-YearStart(EffectiveStartDate)) 

AcquiredAmount:   Sum((Amount*((EffectiveEndDate-EffectiveStartDate)+1))/((EndDate-StartDate)+1))

 

Note: this solution can impact performance when used with huge fact, i remain open for any suggestion or alternative.

Best ragards:

JM;

 

Labels (2)
Comments
Gabi3
Contributor
Contributor

Gracias por sus soluciones mas interesado 

Contributors
Version history
Last update:
‎2021-05-22 06:52 PM
Updated by: