Add value to a given Time Duration



I have a Module A with the following line items, format, and data:

value(Format = Number)start(Format = Date (mm/dd/yyyy))end(Format = Date (mm/dd/yyyy))




I have another module B with Time Dimension and a Line item - value_over_months that will be mapped to module A and expected data to be as given below:

value_over_months101101201201201201201201201 201201201201201201201301301301301301301301301


How can I achieve this?

Best Answer

  • @mohitveer_sandhu 


    So the requirements have changed since the original post?   The best way to do this is to fix the data at the source so you are only loading the correct values that you need.


    With that said, I believe this will work:


    In the first module, create these new line items.

    Real Starting Month: period(start(date))

    New Starting Month: IF PERIOD(Start Date) <> PERIOD(End Date) THEN Real Starting Month + 1 ELSE Real Starting Month

    Days: IF End Date <= 'SYS Time Filter - Month'.End[LOOKUP: Real Starting Month] THEN End Date - Start Date ELSE 'SYS Time Filter - Month'.End[LOOKUP: New Starting Month] - Start Date

    Month to Use: leave blank for now


    Create a new module dimensionalized by Time:

    Max: Data of Numbered LIst.Days[MAX: Data of Numbered LIst.New Starting Month]



    Go back to the "data" module and fill in the Month to Use formula:

    IF Days = Max Nbr of Days.Max[LOOKUP: New Starting Month] THEN New Starting Month ELSE BLANK






    In the target module, change the original sum to now use Month to Use:




    Hope this works for you,




  • Hi @mohitveer_sandhu,

    You can add the time (month) in the same dimension as module A. On the formula, you can try something like if the month (time) is between start and end get the item(value) else blank. Handle the summary, you can use (for eg.) max. Then reference it in your module B.

    I hope this helps you out. 



  • Can you elaborate on how can I add time(month) in module A?

    And also I have a restriction that module A can have only this schema.

  • @mohitveer_sandhu 


    See if this helps.


    I have replicated your data, but changed the years to fit my model:




    In the target module, I have these two line items:

    Value: Data of Numbered LIst.Value[SUM: Data of Numbered LIst.Start Date] where Data Of Numbered List is the name of the source module (the one above)

    Value Over Months:IF Value = 0 THEN PREVIOUS(value over months) ELSE Value








    Hope this works for you,



  • @rob_marshall Thanks, will try this.

  • This works but if we want to extend this to such a data where for a single month there can be multiple values and we want to take only the value that’s true for the majority of the month.


    For example:

    valuestart dateend date


    Module B should have