The calculations use weight as a general basis. You would need to transform your mg/L into the total weight of the amount of actual chemical that you use. Then you would need to find out how much of that weight is usable N, P and/or K. Then you would need to calculate that weight into the total weight of the final solution. Remember the total weight would also include that of the nutrient additive you are calculating for. And, I wouldn't be surprised if there are addition steps needed. I am not a chemist.
Yes, finding out how to calculate percentage of N (for instance) is in a molecule of Ammonium sulfate is difficult, IMO. I am not a chemist, but I would assume you could use the weight of a nitrogen atom against that of the molecule. You will need to investigate the validity of this assumption. Remember also that the macro nutrient percentages given on a fertilizer label is not consistent. The percentage of nitrogen is given as N. The percentage of potassium is give as K₂O, whether or not the K in the product is in that form or not. So additional calculations may be needed. Be wary, too, that a chemical may be offered in a hydrated form (or possibly in some other form), usually for shelf stability, thus requiring another set of calculations.
So my whole point here is that this could become incredibly complex. Yes, if you could find an aforementioned table, or similars, as aids, it'd be helpful, but is beyond anyone here, IMO. Good luck!