TBH, not sure what you are doing.

Many ways to skin that cat, but no need to go for anions, it is actually kinda like grabbing your left ear with your right hand.

Assume there are x g of NaNO_{3} and y g of Na_{2}SO_{4}.

What is the total mass of the sample, x+y?

Now, from molar masses - what fraction of the mass x is Na? What fraction of the mass y? And what do these sum up to?

You have two unknowns x and y, you have two simple equations. Just solve.