A way of determining redundant list items; list items with no data in any module
I'm looking to ensure my modules are as small as possible. In addition to other optimizations I would like to ensure every list item that is contained in some of my bigger reporting modules is needed. I'm defining 'needed' as there is some module in my model that uses the list it's within and has some non-zero value for that list item.
That would be fine if my model only had a handful of modules, however when there are many it becomes quite complex and laborious.
I'm thinking maybe something could be done using the API to iterate through every module that uses a given list, then get the values out of it and compare that to the list items, but I think for that I need to create views and exports for every module specifically for that.
Is this an issue that anyone has encountered before?
There might be an easier way. Using your system module for each of those big lists you can create BOOLEAN filters that find the conditions that warrant a delete. If the BOOLEAN is true, then run the delete action on it.
The trick is when you have multi-dimensional modules that use those lists. So your condition will need to SUM the value to your system module to make sure there are no non-zero values.
Works great for numbers and booleans, not so great for text.
Will that work?1
@JaredDolich thanks for the very quick response. That seems like a reasonable suggestion. My concern would be that I'd need to SUM up every module that uses the list and over time as modules got added I'd have to remember to add them to the formula. I'd also need to create this formula for every list I wanted to do this exercise for.
This definitely seems viable though, thanks!
From looking at the API it looks like there's not quite enough for me to create a script to do it all automatically. (mainly automating data extraction where it's not based on an export or specific view).1
You could obtain a lot of metadata with the new transaction APIs but I doubt it will have everything you need.