I want to count the average number of ingredients in each drug produced by a specific manufacturer in each year.
The results I want should be like this:
year | drug_names | avg_number_of_ingredients
2018 | drugA,drugB | 21
Can someone please help.
What I have done so far? I have tried different queries here : https://open.fda.gov/apis/drug/label/example-api-queries/ but unfortunately, the maximum I can do is count some field following some conditions like the query below:
https://api.fda.gov/drug/label.json?search=effective_time:[20110601+TO+20121231]&count=openfda.brand_name.exact&limit=1
What I want is to group manufacturers and count their drugs per year.
Thanks.