Average of active months

Hi,
I have a module which shows asset values on a quarterly basis. For terminated products, the current asset values are nil.  However, instead of showing nil, I want to show the average asset value when in existence.  In my module there is a line item for product status and this can be active, liquidating, terminated but this may change on a quarterly basis.

Can someone please assist? I've been trying flags

Thanks

 

 

Answers

  • To calculate an average over time ignoring zero's you need a count line item
    In this case, you would say
    if not terminated then 1 else 0

    In a separate module without time, create a calculation for the average
    timesum(Asset Value) / timesum(count)

    Then in your original module add a 3rd line item
    if not terminated then asset value else average value

  • I assume the current average value calculation is correct. The problem here is that you might have a condition where for terminated products, the average calculation stops showing the average value for past months when it was active.

    In this case, you need a Active Quarters Flag at quarterly level and based on that you can show the Asset Amount only for Active Quarters rather that having IF ELSE condition based on status. When status changed to terminated, it shopped showing the asset value.

    Hope this makes sense!