Hi,
My suggestion would be to follow this document---
Load the data in that created dso from datasource 0MAT_UNIT_ATTR--Create transformation--DTP
Once this dso is ready with data.
Now do a look up on this dso from your dso based on material and get the value of counter and denominator.
At bex level you can do the calculations.
Hope that helps.
Regards,
AL