We are not familiar with your data or LDM directly, so it’s a bit difficult to ascertain what exactly is happening; even with metric definitions.
At first glance, I would suggest running a
WORKSPACE VALIDATION to check for missing values in the data. Also, calculating a value between two dates where the date has an ‘empty value’ seems to be an issue.
If that validation is ok, then you may want to check for NULL values in the inner metrics where you can apply 0 values for nulls in source data. These can be based through using an
IFNULL CLAUSE
Lastly, I would suggest to take our free MAQL Metrics course at
GoodData University, where you can learn some best practices for building metrics.