Dear Statalist

I have been struggling with the following issue for quite a while now. Unfortunately I am not able to display any dataex as my data is found on a remote desktop at my workplace. Hopefully my description will make do - my apologies!

And a disclaimer: my issue relates to this question https://www.statalist.org/forums/for...s-in-bar-graph, but I have not been able to grasp exactly how I should approach it though, so therefore I took myself the liberty of asking in a new thread.

Description of my situation
I have population data on 0 to 24 year olds. Furthermore, I have three relevant variables: one displaying which age-bracket the individual belongs to (0-4; 5-9; 10-14; 15-19; 20-24) and another categorical variable displaying which of 11 specific illnesses - if any - an individual might have had. An individual might appear more than once (and app. 50% do that) if they have had two or more illnesses. Lastly, I have a variable indicating the individuals gender.

I am trying to create 11 bar graphs - one for each illness - with the percentage of each sub-group who have had the specific illness on the Y-axis, split into both age-brackets and gender on the X-axis. So for example: the first two bars should reflect the percentage of 0-4 year old boys and girls, respectively, who have had the illness. The next two bars should reflect the percentage of 5-9 year old boys and girls with the same illness, etc. To be more exact: my population consists of almost 2,5 million unique id's but due to the possibility of reappearing, my dataset is almost 4,0 million observations. The aforementioned percentage should only reflect the share of unique individuals.

As labels, I would like to have the number of individuals who have had the illness and this is where I run into trouble. I am able to create the graphs using -graph bar-, but it is not possible to use N as custom labels. In the aforementioned former question on Statalist, it is argued that -collapse- and -twoway- can be used. If that is applicable in my situation as well, I could really use a description of how to approach it.

Thany you!