In a perfect world you would change the database structure so that the area is somehow in a shared field, eg in a table with the fields
Responsible ("component or design")
I'm guessing this is already not possible, so here is my suggestion, without changing the script.
You can use valuelist() or valueloop() to generate dimension values in a chart, which you can then reference in the expression.
So your table would look something like this:
Dimension: valueloop(1,10,1) (genereates 10 values, 1 to 10)
Expression: sum(if(component_responsible = 'area' & valuelist(1,10,1),defects_components))
+sum(if(design_responsible = 'area'&valuelist(1,10,1),defects_design))
In the first sum() I look at all the data and compare each value of component_responsible to the word "area" followed by the number generated in the dimension.
Then I do something similar for the design. Above is assuming you have 10 areas, but you can insert a variable into the function that returns the total number of areas.
Hope this helps.
On a similar thread (and again much easier) you could create a stand alone table of distinct areas.
load distinct Component_responsible as Area resident main_table;
You could then use that as the dimension and perform a similar expression to the one above where you compare your component responsible and design responsible to the stand alone area dimension.