Using Sum on List Items

Hi,

 

In one of our models w have weeks as a list item, with approximately 76 weeks in total. In one module, each week has a line item 'Score'. In a separate module I'm trying to calculate the sum of score in a 4 week period (between weeks 31 and weeks 35. How would I go about doing this?

 

Thanks

 

Best Answer

  • @EHarris 

    Assuming I have read it correctly that weeks is a list and not native time, if the list was created in the correct order, then it is a little know fact that you can use CUMULATE

    2019-11-20_08-56-07.png

     

    2019-11-20_08-59-35.png
    2019-11-20_09-00-15.png

    You can then look for the final week and then subtract the start week.  If the below I've kept it really simple and entered the start after.  

    2019-11-20_09-09-31.png

     

     If you want the entry to be week 31, then set up a module that holds the mappings and then use that to calculate the "start after" week

    2019-11-20_09-05-30.png

     

    2019-11-20_09-06-45.png

    I hope that helps

    David 

     

Answers